RESOLVED FIXED 70687
Typed arrays are 10X slower than normal classic arrays
https://bugs.webkit.org/show_bug.cgi?id=70687
Summary Typed arrays are 10X slower than normal classic arrays
Joseph Huckaby
Reported 2011-10-22 18:57:08 PDT
Using a simple for loop reading and writing single values from typed arrays vs. normal arrays, the performance difference is staggering. Typed arrays are all about 10X slower than normal arrays. This strange behavior only occurs in Safari (running the very same test in Chrome and Firefox the typed arrays win outright, as they should). See the test page for details and source code: http://jsperf.com/read-write-typed-arrays/2 Reproduced in Safari 5.1, 5.11 and WebKit Nightly Build (Oct 18 2011) on OS X 10.7.2.
Attachments
Geoffrey Garen
Comment 1 2011-10-24 12:11:51 PDT
Oliver Hunt
Comment 2 2011-10-24 12:19:22 PDT
Yeah, we know about this. The problem is essentially that WebKit still uses DOM-based typed arrays, which leads to most of the perf issues we see here (essentially they get the worst performance it is possible to achieve in JSC currently). Fix is non-trivial, but it also won't be the hardest thing in the world to achieve.
Joseph Huckaby
Comment 3 2011-10-24 12:23:35 PDT
Cool, thanks guys. I figured you had to know about it, just didn't see it in Bugzilla :)
Michał Gołębiowski-Owczarek
Comment 4 2013-12-13 04:49:37 PST
I don't see any slowdown in Safari 7.0, has this issue been fixed?
Alexey Proskuryakov
Comment 5 2013-12-13 09:24:05 PST
This particular bug is believed to have been fixed in Safari 6. There were many additional optimizations afterwards, including a rewrite that happened recently, after Safari 7.
Joseph Huckaby
Comment 6 2013-12-13 10:03:51 PST
I can confirm the speed has greatly improved in Safari 6.1 (I don't have 7 yet).
Alexey Proskuryakov
Comment 7 2013-12-13 10:32:26 PST
Could you please test with Safari 6.1 and nightly build, as well? http://nightly.webkit.org
Michał Gołębiowski-Owczarek
Comment 8 2013-12-13 10:41:10 PST
In the test under http://jsperf.com/read-write-typed-arrays/2 WebKit Nightly is faster than Safari 7, especially in Uint32Array tests.
Note You need to log in before you can comment on or make changes to this bug.