With Firefox OdinMonkey, JavaScript Approaches Native Speeds

Mozilla has added support for asm.js to Firefox 22 Nightly

Mozilla recently introduced IonMonkey, the latest generation JavaScript engine for Firefox. IonMonkey comes with plenty of improvements over its predecessor and is definitely faster.

But the best thing about the engine is that it's modular, it was built to allow new optimization methods to be added at a later date without having to rewrite too much or any code.

Mozilla is already taking advantage of this system with what it calls OdinMonkey, its implementation of asm.js.

OdinMonkey is now shipped with Firefox 22 Nightly, which will reach the stable channel in June. OdinMonkey should be enabled by default in Firefox 22 at that time, if everything goes according to plan.

OdinMonkey enables applications designed with asm.js in mind to run significantly faster than a pure JavaScript app would. In fact, asm.js apps should approach native speeds, a properly written asm.js app should only be two times as slow as the same code compiled for a native app.

That may not seem like much, but JavaScript apps are 10, 20 times slower than native code, even more in many cases.

What's more, asm.js was designed for code written in C/C++ and then converted to JavaScript. This should mean game developers in particular should have a much easier time "porting" their code to the web.

The parallel with Google's Native Client is not coincidental, but Mozilla's approach has some big advantages. Here's how asm.js and OdinMonkey work in greater detail.

For the moment, only the Windows and Firefox builds support OdinMonkey. However, the Mac OS X builds are almost ready and so is the Firefox for Android ARM build. They should be ready by the time Firefox 22 ships.

You can check out the performance improvements for yourself by grabbing Firefox 22 Nightly and testing it with BananaBench. You should run it on another Firefox version first and then compare the results.

Hot right now  ·  Latest news