[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] WebKit 20-50% slower than Chrome/Minefield using large Float32Array Arrays
- To: Stephen Bannasch <email@example.com>
- Subject: Re: [Public WebGL] WebKit 20-50% slower than Chrome/Minefield using large Float32Array Arrays
- From: Kenneth Russell <firstname.lastname@example.org>
- Date: Thu, 17 Feb 2011 16:51:05 -0800
- Cc: Thatcher Ulrich <email@example.com>, firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1297990991; bh=ehG80IBU+R5Gn7IzyXF3zQWhSuc=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=pY2yB8J9IawjC8iiXoc4cCWWrJPgpY82/O05RhCf700KTP8v/S7kIWH6jERza4wyz sa2w/bmevwme60EQHst9A==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qn+u6p4I2uVceQJnwQsRmknl8V7B5+VDi/x53JRL3Ww=; b=rwQEbFxgYb1K1jxBu915aC8czWIcRiazVoaQe00KgQkkgAVci+YGC6TqyZ8oRIC+// Pxo0czfRLLWjT/4BZUJg==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Kko4ST7O6zzLFfcn+M+V8iQsKMJjF/oshZmDGXAA6hF6KctZWVw6/XchIDZfeTozc7 OllCUNnKUgdeayafYtBg==
- In-reply-to: <email@example.com>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <firstname.lastname@example.org> <AANLkTin8wKjQyMTBANmRRoteKRmNtwD4VcBetzFX0RMu@mail.gmail.com> <email@example.com>
- Sender: firstname.lastname@example.org
On Thu, Feb 17, 2011 at 4:16 PM, Stephen Bannasch
> At 11:23 AM +0100 2/17/11, Thatcher Ulrich wrote:
>>One thing you should try, without even going to WebGL, is filling the
>>canvas using context.putImageData() instead of lots of fillRect calls.
>> Perhaps also best to render into a 100x100 canvas, and have the
>>browser scale it onto the correct size on the page, instead of doing
>>that in your paint routine.
> Thanks for the suggestion, it works much better. I implemented it and the canvas renderings is about 50% faster.
>>The other thing you should definitely do is make a color table instead
>>of making and parsing "hsl(...)" strings for every pixel.
> The div-stuffing method is now slower than the canvas rendering but it wasn't that slow.
> The div-stuffing method pre-generates 256 css rules, inserts them into the stylesheet and 256 div strings and puts these into an array. Later when generating the string to insert with innerHTML I build it out of the pre-computed array of div strings that reference each of the 256 styles.
> But ... there's a new mystery! A colleague asked how much slower it would be if I didn't use typed arrays ... so now there are two alternate implementations that link to each other:
> On my Chrome version 9 using regular arrays and rendering runs about 7.1 fps while using typed arrays is slower at only 5.4fps.
> On plain old Safari v5 I'm getting 3.6 fps.
> Without rendering Chrome 9 runs about 41 fps using regular arrays and only about 31 fps with the Typed Arrays. Minefield isreversed running about 41 fps using Typed and 28 fps using regular arrays.
> Regular Safari runs about 21 fps without rendering.
> I have made a few other changes in the model but none that I thought would slow doiwn typed-arrays.
Just FYI, further optimizations are planned for typed arrays in V8.
that aren't in place for typed arrays.
You are currently subscribed to email@example.com.
To unsubscribe, send an email to firstname.lastname@example.org with
the following command in the body of your email: