WebGL now faster than Flash?

Posted on:May 10 2012

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.


It's not that surprising really. There are a couple factors involved:

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.
2012-05-10 09:25:00

With firefox 12 on linux the results are interesting: WebGL gets noticeably better framerate than flash, plus it's antialiased.
But on the "Backyard Demo" the WebGL version completely freezes for 1 or 2 seconds at regular intervals. I wonder if those could be GC pauses?
2012-05-10 12:13:00

Just tested the Backyard Demo in Chromium and it doesn't freeze like Firefox, but on the other hand it has much worse framerate (about comparable to the flash framerate)
2012-05-10 12:19:00

...the WebGL renderer is faster _than_ the one...
...that WebGL is now faster for them _than_ Flash...
2012-05-10 13:49:00

Yes, seems also to be dependent on the OS and browser, of course.
@Bob: thx, corrected :)
2012-05-10 14:19:00

The bytecode vs. sourcecode advantage only influences startup time. Bytecode compilers normally do not optimize. That's all done at runtime.
2012-05-10 15:08:00

I guess on linux, everything is faster than flash.

And I definitly want one of these coachbags :D
Kai Mast
2012-05-13 23:11:00

delete this topic, admins
2012-05-15 21:48:00

Add comment:

Posted by:

Enter the missing letter in: "Internatio?al"




Possible Codes

Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]