During the last weeks, quite a few people using
CopperCube are reporting that they are discovering surprising performance testing results: It appears that for them, the
WebGL renderer is faster than the one using
Flash and Stage 3D.
Personally, I wasn't able to reproduce these results myself, although I must say that browser developers have improved the JavaScript performance very much recently, especially in Chrome and Firefox. Also, it sounds a bit strange, because Flash is statically compiled down to bytecode, while JavaScript is still very dynamic, and the WebGL 3D engine behind CopperCube, namely
CopperLicht uses some of the dynamic features, for example for storing allocated render buffers, WebGLFloatArrays (or Float32Array as they are called now), and similar.
It could be that those CopperCube users reporting that WebGL is now faster for them than Flash are maybe running some throttled flash player (maybe the debug version?) or similar, but it's stange that this is happening now at the same time and that there are quite a few of them. Anyway, it would be nice if you could drop me a line or post a comment if you are having a similar experience.
1) JS has been pulling ahead of actionscript for a while now, at least on Chrome's V8. The JS-JIT by V8 is just really, really good (especially in the hands of an experienced developer that gives it all the right clues). Precompiling to bytecode still may offer some advantages, but those are rapidly melting away.
2) The architecture chosen by the Mozilla/Chrome teams may be hugely beneficial to rendering speed (off process rendering)
3) Composition of the webgl content with the page has been heavily and deeply optimized by the browsers, in a ways that plugins simply can't (syncing to animation frames, using extensions and texture sharing for page composition, etc.)
4) Chrome/Firefox and the angleproject have a lot of companies behind it and they are completely open so anybody can submit a patch and try to convince the maintainers to take it. Since the WebGL community has been pounding on speed a lot, it's not surprising that a good amount of changes where brought forward to make WebGL the best it can be (it's Apple, Google, Mozilla and the Public pulling on the same rope). Adobe just has whatever engineers it hired (probably not all that many) to improve Flash Stage3D. It's an asymetric competition.