Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Internet Life

November 11th, 2011, 10:42 GMT · By

JavaScript Type Inference in Firefox 9 Beta Leads to Huge Speed Improvements

SHARE:

Adjust text size:


Firefox 9 comes with type inference in JavaScript for performance boost
Enlarge picture
Several days after Firefox 8 landed in the stable channel, beta users are finally getting Firefox 9, which has graduated from the Aurora channel. There aren't any surprises with Firefox 9 Beta, everything that was expected is there.

The big new feature in Firefox 9 is type inference for JavaScript. That may not mean much to regular users, but developers will know the importance of this.

It's a big project at Mozilla, some of its developers have been working on it for over a year and it is now ready for the big time.

One problem with JavaScript, from a performance stand point, is that variables are not give a type, i.e. integer, string and so on, from the get go but the type is determined by whatever the code does with the variables.

This adds a lot of flexibility to writing and managing the code, but it means that JavaScript interpreters have to account for this and treat each variable as an abstract type that can hold any type of value.

The SpiderMonkey JavaScript engine in Firefox 9 analyzes the code and predicts the type of the variables. Then, it uses that predictions when generating JIT compiled code.

This results in smaller and faster code and lower memory requirements, although that is offset somewhat by the memory used to determine the types.

"Firefox 9 includes modifications to the JaegerMonkey JIT compiler to use inferred type information. This compilation mode, which is the default in Firefox 9, speeds up major benchmarks like Kraken and V8 by over 30%, and gives a large speed boost to many JS heavy websites," Brian Bondy, Firefox Engineer, explained.

But even now that the type inference technology in Firefox 9 is complete, Mozilla is working on making more use of it. It's next generation JIT, IonMonkey, which is still some time away, will be built with type inference in mind, so the performance improvements should be even greater.

TELL US WHAT YOU THINK:

1,776 hits · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Google Chrome 16 Introduces a New Bubble View UI for Errors

Firefox 9 Aurora Comes with Faster JavaScript, More Under-the-Hood Tune-Ups

Firefox 9 Beta Is Almost Ready, Here's What You Need to Know

Mozilla Plans Big Memory Usage Improvements for Firefox 10, 11 and Beyond

Download Opera 12 Build 1065 Pre-Alpha with Perfect JavaScript 5.1 Compliance

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM