[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] WebKitCSSMatrix and WebGL
- To: public webgl <firstname.lastname@example.org>
- Subject: Re: [Public WebGL] WebKitCSSMatrix and WebGL
- From: stephen white <email@example.com>
- Date: Tue, 7 Dec 2010 17:52:45 +1030
- In-reply-to: <90DC21F8-9B26-4BD6-BDEB-11BE617F3BAA@apple.com>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <E593CEF3-9758-479B-B527-BF24D9811032@adam.com.au> <90DC21F8-9B26-4BD6-BDEB-11BE617F3BAA@apple.com>
- Sender: firstname.lastname@example.org
On 22/06/2010, at 4:02 AM, Chris Marrin wrote:
> In doing some informal benchmarking, I'm not seeing significant speedup. I believe this is mainly due to the fact that CSSMatrix is immutable (i.e., it returns a new CSSMatrix from every call). This causes a lot of GC churn which affects performance. We made it immutable to match SVGMatrix, but in retrospect, that might have been a mistake. I'm looking now at possibly trying to change the CSSMatrix spec to mutate the passed matrix in place, or at least add methods that do mutation.
> Interestingly, J3DIMatrix can also use a "copy" function. This is a method I experimentally added to CSSMatrix. You pass a Float32Array with space for at least 16 floats and the current matrix will be copied into it. This yielded an improvement of 30-40% over both the version that did matrix math in JS and the CSSMatrix version which picked values out of the matrix by hand. This tells me that CSSMatrix probably IS faster, but the GC overhead is eating all that extra performance. It also tells me that with a few small changes and additions, we can significantly improve matrix math in WebGL.
If I could revisit this previous topic, I'm coming up to some code where I'd like to use CSSMatrix where available (and hence J3DI). I'm curious whether the copy functionality was added to CSSMatrix to improve matrix math in WebGL?
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: