Measuring ASM.JS performance
What is ASM.JS?
About the tests
All tests can be run in your browser, most of them are fully automatic and don't need any special setting.
The system configuration used for testing:
The tests ran on the latest official releases and on a build of EFL MiniBrowser:
Chromium has no official Windows build (unless you count Chrome as one), and EFL WebKit currently has build issues on Windows, so they were tested only on Linux.
The first set of tests results are scores, so higher values are better, while others show the required times to complete the test, and lower values win there.
As you can see, in most cases Blink/WebKit based browsers win here, often with significant difference compared to Firefox.
Computation performance tests
Now let's see how well can browsers handle asm.js code. The following tests are simple handwritten scripts, they show the number of operations per second for each test case.
And the results:
These tests show a surprising difference between browsers. In some of them Firefox has horrible performance, then in others it is twice as fast as the competition. It seems the results depend on too many things, so we can't clearly name a winner here.
The embenchen benchmark suite is a collection of performance testing codes (micro) and real-world examples (macro). They were converted to asm.js using Emscripten.
The benchmark was run 5 times. This table shows the averages for each test, and you can also find the 95% confidence intervals in the full statistics, attached to this post.
In this set Firefox wins for almost every test. While the difference in the micro benchmarks is not too big, the macro tests (box2d, bullet, lua_binarytrees, zlib) run significantly faster on Firefox. These complete 2-3 seconds sooner than in other browsers, meaning about 20-30% performance increase in most cases.
Multimedia and real-world uses
The most well known use of asm.js is the many web applications, converted from native code using Emscripten or other softwares. Most of these also use WebGL, as this technology allows developers to port every kind of graphics softwares, including 2D and 3D games, emulators and so on. It is important to note that by using advanced graphics, the computer's video card and driver software can heavily influence the user experience - and the test results.
These tests show the real power of asm.js and what can be done by using it. The winner is Firefox here, and depending on the platform (Linux or Windows), Chrome has nice result in some cases too.