Mozilla was pleased with the news about the next performance improvement of Asm.js. This intermediate language provides extremely fast execution of code written in languages like C and C ++, is a free alternative to the Google Native Client and works in any browser (although the fastest in Firefox).
For example, after compiling C ++ code in Asm.js using the Emscripten compiler, the performance loss was about two times earlier, but now the Asm.js code is no more than 1.5 times slower than the native program.
Some of the optimizations made are small and minor, while others are more serious. For example, Firefox recently learned how to optimize certain floating point operations so that instead of float64 numbers, calculations are performed with less accurate float32 numbers, which gives a very large increase in performance. The corresponding change was made to Asm.js, the Emscripten compiler and the SpiderMonkey engine. The diagram shows the speed of operations in different environments, relative to clang 3.2 (taken as a unit). Less time corresponds to a better result. ')
Firefox with generated Emscripten code using 32-bit numbers (firefox-f32) is shown in red. As you can see, Asm.js operations are performed very close to the native speed in the operating system. The maximum difference is the same 1.5 times, and in some cases, Firefox shows even better performance!
The developers promise to continue to optimize further, although now, for example, the Unreal Engine 3 runs fine in the browser. At one time it was one of the first demonstrations of Asm.js.