[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] WebKitCSSMatrix and WebGL
On Dec 6, 2010, at 11:22 PM, stephen white wrote:
> 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.
> Hi Chris,
> 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?
Unfortunately not yet. But I will look into doing it.
I've opened a bug for it, if you want to track it: https://bugs.webkit.org/show_bug.cgi?id=50633
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: