The test program is a mobile app that creates a fountain of particles that follows the accelerometer, in two tabs. The fist tab is written completely in JavaScript (running inside a webview) and draws the particles on an HTML canvas. The second tab uses openGL to render the particles but gets the coordinates and number of particles from JavaScript. You can download the source code for the app from MoSync Labs' github page. I know it might not be the optimum benchmark, but it is a good start.
Our intention was to find out if HTML Canvas is good enough for creating complex animations. So we grabbed a bunch of devices and ran the application. We found some very surprising results that I share with you here. Below is a table with the devices we used and their operating system information:
and here you can see a chart comparing performances:
There are some really interesting results in this test. First, in iOS 5 HTML canvas is very fast (even faster than openGL in some cases). Next, we can see a trend in performance improvement on different platforms that is helping the Canvas to catch up with openGL. Finally, OpenGL is still a good bet on getting consistently high performance on many platforms.
We are working on a more complete benchmark, which we will test on many more platforms, especially newer ones. So stay tuned for further posts and results.
Don't forget to download the source and try it our on your device. You can get it from MoSyncLabs' github page.

.png)
Embedded web views often have worse performance than MobileSafari. It would be interesting to see how well Safari performs.
ReplyDeleteI noticed iPad 2 and iPhone 4S framerates for OpenGL are suspiciously close to 60 fps. I suspect there's some capping going on there.
Thanks for pointing it out, You are right, there is some capping going on and that's on iOS
DeleteWell We are working on another version which is a better benchmark, this one was very simple.
ReplyDeleteI'll try to post the results of different browsers using the new benchmark very soon.
Android 4+ Jelly Bean's improved renderer made impressive strides. Would love to see a refresh of the results. In this example , Android/Opera came out on top with iOS 6 below Android/Chrome above iOS: http://html5test.com/results/mobile.html
ReplyDelete