Mozilla beefing up JavaScript performance with new JIT compiler
In an effort to keep Firefox competitive with commercial browsers and handle the ever-heavier burden that interactive webpages put on browsers’ scripting engines, Mozilla is working on a new JavaScript just-in-time (JIT) compiler architecture for Firefox’s SpiderMonkey script engine that will significantly boost the browser’s performance. Called IonMonkey, the JIT is now part of the nightly Firefox test builds, and is set for wide release as part of Firefox 18.
In a post on Mozilla’s JavaScript blog, Mozilla developer David Anderson said that the architecture of IonMonkey uses a three-step compilation process for JavaScript that mirrors how production compilers for languages such as C++ and Java work, performing analysis and optimization of the intermediate representation (IR) of the script code before turning it into the machine code run by SpiderMonkey. In the current JägerMonkey JIT, there is no optimization step. IonMonkey is targeted at long-running JavaScript applications; for shorter ones, Firefox will continue to use the current JägerMonkey JIT.
The initial performance results for IonMonkey are substantially better than previous versions of the JIT. On Google’s V8 benchmark, the test version of Firefox 18 scored a 7 percent improvement in performance over Firefox 17; with Mozilla’s own Kraken benchmark, IonMonkey resulted in about a 26 percent performance boost over Firefox 17. “We’re excited about this not just for performance and maintainability,” Anderson wrote. “but also for making future JavaScript compiler research much easier. It’s now possible to write an optimization algorithm, plug it into the pipeline, and see what it does.”
No comments:
Post a Comment