Firefox 9 Gets Big JavaScript Performance Boost

Martin Brinkmann
Sep 4, 2011
Updated • Mar 15, 2012

Good news for all Firefox users, especially those running the latest Nightly builds of Firefox 9 or those planning to upgrade to the new version of the web browser once it becomes available in other Firefox release channels.

Mozilla developer Brian Hackett worked on a new feature called type inference for over a year. You may know that you need to define types for variables in some programming languages, while it is not necessary to do that in others. JavaScript for instance does not require type definitions for variables. The downside here is that this practice can have an impact on performance.

Type inference now refers to an algorithm that is automatically deducting the type of an expression.

Type inference is boosting Firefox JavaScript performance big time. Mozilla's David Mandelin noticed JavaScript performance improvements of up to 44%.

On my machine, TI takes our Kraken score from about 4900 to about 3400, a 1.44x speedup. And on V8-v6, our score goes from about 5000 to about 6600, a 1.3x speedup.

Sebastian Anthony over at Extreme Tech did some measuring of his own and came to the conclusion that the performance gains depend largely on the benchmark used. He noticed performance improvements between 15% to 30% in benchmarks on a Intel i7 930 processor with 6 Gigabytes of RAM and a fairly speedy Nvidia GTX 460 video card.

With Firefox 9, and without type inference, the Kraken benchmark takes 3895 milliseconds; with type inference enabled it takes just 2763 milliseconds. Firefox 9, without type inference, scores 6075 on the V8 JavaScript Benchmark; with type inference, the score jumps up to 6585. Even on banal tests like Microsoft’s HTML5 Sudoku, type inference improves the solving time for 10,000 grids from 2.6 down to 1.62 seconds — and yes, the FishBowl framerate, at 2,000 fish, is increased by 15-20% with type inference enabled.

Interested users can download the latest Mozilla Central release with type inference enabled from the official Mozilla ftp server. The next Firefox channel to get type inference is Firefox Aurora, which is going to be released on September 27. Firefox Beta will get the feature on November 8, and the stable channel on December 20.


Tutorials & Tips

Previous Post: «
Next Post: «


  1. Coyote76 said on September 8, 2011 at 11:34 pm

    About the performance boost of 40% in consideration of the “Intel i7 930 processor with 6 Gigabytes of RAM”

    I have a cheaper system of 1 yo: Athlon II x4 635 with 4gb ram and ATI5770. i did a Kraken test with FF9.0 Nightly, TI was enabled and also with FF 6.0.
    My results were:
    FF 6.0: 10465
    FF 9.0: 5479

    This is a 90% improvement! Although Kraken did almost only benefit of Ai-astar (4730ms –> 310ms) and a bit on the audio-benchmarks.

  2. ColdFusion Developer said on September 6, 2011 at 7:01 pm

    So does this mean that the new algorithm will determine what ‘type’ each variable is much faster? Or does this mean that if users define the ‘type’ of variable that the scripts will run faster?

    1. Martin Brinkmann said on September 6, 2011 at 10:01 pm

      It means that the algorithm will determine the type.

  3. BalaC said on September 5, 2011 at 9:57 am

    I am on stable releases and it still reads 6.0.1 version in my firefox. Can’t find version 6.0.2 in firefox homepage as well. How do you guys get 6.0.2, is it anything specific to location ?

    1. Nico said on September 5, 2011 at 4:42 pm
      1. BalaC said on September 6, 2011 at 9:13 am

        Thanks Nico for the information, I better wait for official release from mozilla.

  4. ilev said on September 5, 2011 at 8:04 am

    ” Intel i7 930 processor with 6 Gigabytes of RAM and a fairly speedy Nvidia GTX 460 video card.”

    So, 40% boost in java script for those who invest $5000 in a Windows PC ? Who the hell out of millions of Firefox users has such hardware ? Most still use old dual-core cpu, 1GB memory and onboard/memory shared video gpu. Will these users get 40% boost too ?

    1. Martin Brinkmann said on September 5, 2011 at 8:57 am

      I have no idea. Even with a slower computer, I’d say that you should get a considerable boost.

  5. Fara said on September 5, 2011 at 4:28 am

    Honestly, I think mozilla should focus on their gecko rendering engine because it still lags like a fat pig that it’s almost unbearable. It doesn’t matter how fast their ti/tm/etc can compute when their rendering engine can’t keep up.

    After a couple hours of usage, the UX is completely stoked and stuff like tabs animations, scrolling, and responsiveness just stall considerably. The user don’t care what the background is doing when the whole UI become unresponsive.

    I find my self using IE9 more these days as a result of current FF lagfest.

    1. EuroScept1C said on September 5, 2011 at 6:19 am

      That’s why the project “Electrolysis” is for… But of course, won’t be easy at all. To change radically how the browser works, while you’ve been building it with a specific way for years… You understand.

  6. Security said on September 4, 2011 at 9:32 pm

    “The Dutch government has since audited DigiNotar’s performance and rescinded this assessment. We are now removing the exemption for these certificates, meaning that all DigiNotar certificates will be untrusted by Mozilla products.”

    Firefox 6.0.2 and 3.6.22 will remove and revoke all DigiNotar certs because you simply can’t trust them due to the massive security breach now that more information is known.

  7. Ahmad said on September 4, 2011 at 9:17 pm

    There is still regression with Type Interference disabled from preferences, for better measurements, it is better to do comparison one day before build. Sorry to not add it in last comment.
    Thanks for sharing this information on your blog, I was waiting.

  8. Paul(us) said on September 4, 2011 at 6:37 pm

    Something completely different/off topic: Today i downloaded version 6.02.
    Two new releases in a few days?

    1. AFirefoxFan4Ever said on September 4, 2011 at 10:22 pm

      that was a security update to fix the google domain certificate issue that made a huge trouble in internet the last couple of days

    2. Ahmad said on September 4, 2011 at 9:14 pm

      First update 6.0.1 disabled certificates but it blocks certificate of Netherlands as well. So second update was to re-enable Netherland related certificates. Also second update got better revokation of certificate in NSS.

    3. Martin Brinkmann said on September 4, 2011 at 6:42 pm

      Good question, no idea what it is about but they are usually rushing releases when security is at stake.

      1. Nico said on September 4, 2011 at 7:50 pm

        Hi Martin,

        Security is definitely at stake!
        This is probably because of the Diginotar hack.
        Searching Google for “Diginotar” entries over the past week gives more than 260.000 hits…

      2. Martin Brinkmann said on September 4, 2011 at 9:53 pm

        Thanks Nico for your input.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.