Main menu:

Site search

Categories

Archive

Jägermonkey: it’s in ur browser!!!

At the beginning of this year, the Mozilla JavaScript team started a new project, code-named JägerMonkey, with a simple goal: make us fast.

Our previous major engine upgrade, TraceMonkey, gave Firefox 3.5 a big speed boost. But while the technology inside TraceMonkey makes it faster than any other engine on certain programs (then and now), it doesn’t help other programs as much. And the web has grown more complex, with more and more JavaScript-intensive demos, apps, and games. And the competition has been getting a lot tougher, with engines that could run fast on bigger and prettier web apps. We knew we needed another major upgrade for Firefox 4.0, to make us fast all around.

So, we went off for 8 months of studying the classic research, reverse engineering the competition, measuring, experimenting, designing, prototyping, analyzing performance, scrutinizing assembly code, redesigning, coding, and lots and lots of debugging. David Anderson and I intend to blog more about the techniques and technologies we used in our copious free time in the weeks between now and release.

As part of the project, we revamped the JavaScript engine’s fundamental value type, touching about 20,000 lines of code, which I compared to a vascular system transplant in an earlier post. We imported a couple of basic components, the assembler and the regular expression compiler, from WebKit’s JavaScriptCore. We created a new cross-platform whole-method JIT compiler in about 23,000 lines of code. It supports x86, x86-64, and ARM in an almost entirely shared compiler code base, the only JS engine that does so (to our knowledge). And it all works together with the existing TraceMonkey trace JIT compiler.

You can try the new JavaScript engine now in Firefox 4 beta 7. If you try them, you should see:

  • Big improvements in benchmark scores. Those aren’t the main goal–but they are a really convenient target for us to aim at.
  • Things just feel faster, especially big JavaScript-heavy things like Gmail and Facebook. That’s subjective, so as an engineer I feel a bit funny touting it, but that’s what early users are saying, anyway. :-]
  • Cool demos and games work great now. You can play a good game of Super Mario Bros in JavaScript now. Or play some Gameboy. Or try a fluid simulator.

Keep in mind that these are only preview builds, and we are not done yet, which means:

  • We should be a little bit faster yet by the time Firefox 4 is released. In particular, we’re still working on making function calls faster, which should speed up pretty much every non-tiny JavaScript program.
  • If you come across something where our speed is not up to scratch, let us know! (For that matter, if you come across something that Jägermonkey works great on, we’d feel good hearing about that too!) We still have time to fix performance issues or add a key optimization or two. Filing a bug is the most convenient way for us (and this link should save you from any need to dig through Bugzilla). But the important thing for us is to find out, so always feel free to just send us an email.

For me, one of the most satisfying parts of this project has been working together as a team. You can just feel it when a team really comes together, each person knowing what their teammates are up to and naturally supporting and depending on each other. Both the Jägermonkey team and the larger JavaScript team really came together this year–it’s been great.

Another cool thing is that we dared to give key pieces of the project to our interns this summer, and they all came through!

The rest of the JavaScript team made our project possible: they kept the lights on in the rest of the JS world, and put together some critical components Jägermonkey needs to work correctly. We got some nice help integrating with the rest of the browser from mrbkap and peterv. The community helped us out, especially with testing, finding performance problems, and, most of all, cheerleading and moral support. I’d especially like to acknowledge the people outside the core JM team who contributed code: platform engineer Brian Hackett, who created many excellent optimizations; Julian Seward, who needs no introduction, and did us a big favor in porting over WebKit’s assembler; Bill McCloskey, who just started but already wrote a JM patch and is optimizing integration with the tracer; and contributor Jan de Mooij, who wrote several optimization patches.

Finally, here’s the Jägermonkey team: from left to right, Andrew Drake, Alan Pierce, Sean Stangl, David Anderson, Luke Wagner, Chris Leary, and Dave Mandelin.

Comments

Comment from harianderson
Time: October 20, 2010, 10:53 pm

I really loved this post. You write about this topic very well. I really enjoy reading your blog and I will definetly bookmark it! Keep up the interesting posts

Comment from phlebotomy certification exam
Time: October 21, 2010, 6:46 pm

That is awesome. Some links to the benchmarking studies would have made it even better.

Comment from bob
Time: October 24, 2010, 1:02 pm

Congratulation on the major achievement
keep going!

Comment from shableep
Time: October 24, 2010, 4:50 pm

this is simply awesome. thank you for kicking ass.

it’s gonna be nice to go back to the awesome bar. chrome’s omnibar is just awful.

when i type “g maps” in chrome, it offers me to search for “g maps” (despite my history browsing google maps). it really has no idea what to do.

when i type “g maps” in firefox, it offers me the most visited result involving the letter “g”… and the word “maps”. it takes me to maps.google.com

the fact that your method is simple, fast, and consistent is a real blessing. so thanks for that, too.

Comment from Damon
Time: October 27, 2010, 1:34 am

There always seems to be more to learn about your browser, especially with an open source browser where new features are being added on a daily basis.

Comment from The Woodlands Haunted House
Time: October 30, 2010, 11:35 am

I like Firefox too. Firefox is so great for SEO stuff. The constant updates are great too. I hate when exployer updates, it takes for ever.

Comment from yildiz tilbe dinle
Time: October 31, 2010, 3:35 pm

thanks soo much

Pingback from Firefox 4 gets much, much faster | Advanced E-Commerce,E-Business, Online Store Solutions | Advanced E-Commerce,E-Business,Online Store Solutions|CyberSharq Inc.
Time: November 10, 2010, 4:57 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from New Beta Release Gives Firefox a Shot of Jäger | xandot.com
Time: November 10, 2010, 5:03 pm

[…] The enhancement sure to make the biggest splash is Firefox’s new JägerMonkey just-in-time JavaScript compiler. Complicated, JavaScript-heavy sites like Facebook and web apps like Gmail will be more nimble, and you should see a big speed increase on games and demos that previously only impressed those running Chrome or Safari. It’s a rewrite of the TraceMonkey code that powered previous versions of Firefox (love the naming convention, by the way) and you can read more about the change on Mozilla engineer David Mandelin’s blog. […]

Pingback from CPU Nation | Web Network | Blog | Firefox 4 gets much, much faster
Time: November 10, 2010, 5:13 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from New Beta Release Gives Firefox a Shot of Jäger | websiteproblems.co.uk
Time: November 10, 2010, 5:53 pm

[…] The enhancement sure to make the biggest splash is Firefox’s new JägerMonkey just-in-time JavaScript compiler. Complicated, JavaScript-heavy sites like Facebook and web apps like Gmail will be more nimble, and you should see a big speed increase on games and demos that previously only impressed those running Chrome or Safari. It’s a rewrite of the TraceMonkey code that powered previous versions of Firefox (love the naming convention, by the way) and you can read more about the change on Mozilla engineer David Mandelin’s blog. […]

Pingback from Firefox 4 gets much, much faster
Time: November 10, 2010, 6:04 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from Firefox 4 gets much, much faster. | 2Techz.Com – Solve Computer Problems, Up To Date Tech. News, Software Downloads, Fully Functional Discussion Forum and more!
Time: November 10, 2010, 6:10 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from Tech Reviews » Firefox 4 gets much, much faster
Time: November 10, 2010, 6:34 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from Firefox 4 gets much, much faster | TECHNOLOGY NEWS
Time: November 10, 2010, 8:00 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from New Beta Release Gives Firefox a Shot of Jäger | Programming Blog
Time: November 10, 2010, 11:16 pm

[…] For the full list of what’s new, check out the release notes. Here’s what has us the most excited. The enhancement sure to make the biggest splash is Firefox’s new JägerMonkey just-in-time JavaScript compiler. Complicated, JavaScript-heavy sites like Facebook and web apps like Gmail will be more nimble, and you should see a big speed increase on games and demos that previously only impressed those running Chrome or Safari. JägerMonkey is new code that works in tandem with the same TraceMonkey JavaScript code that powered previous versions of Firefox (love the naming convention, by the way) and you can read more about the change on Mozilla engineer David Mandelin’s blog. […]

Pingback from MozillaZine.jp » Blog Archive » Firefox 4 Beta 7 がリリースされた
Time: November 10, 2010, 11:40 pm

[…] JägerMonkey の実装および SpiderMonkey インタープリタ、TraceMonkey Just-in-Time コンパイラの改良による JavaScript パフォーマンスの強化 (詳細は David Mandelin 氏のブログ記事を参照されたい) […]

Pingback from Firefox 4 gets much, much faster » Mohinder's Blog
Time: November 10, 2010, 11:48 pm

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from Mozilla Firefox 4.0 Beta 7 liberado y disponible en español
Time: November 11, 2010, 1:46 am

[…] Se incluye el motor JavaScript JägerMonkey, más rápido – Se habilita WebGL por defecto en Windows y Mac OS – Ahora ciertas operaciones de […]

Pingback from Firefox 4 beta 7 is Faster Firefox !!! | Tech Alphabet
Time: November 11, 2010, 2:56 am

[…] benchmarks, and five times faster than Firefox 3.6.12 on the V8 benchmark. Engineer David Mandelin stated in a blog post that Firefox 4 will be “a little bit faster” by the time it’s […]

Pingback from Media Blog » Blog Archive » New Beta Release Gives Firefox a Shot of Jäger
Time: November 11, 2010, 3:33 am

[…] The enhancement sure to make the biggest splash is Firefox’s new JägerMonkey just-in-time JavaScript compiler. Complicated, JavaScript-heavy sites like Facebook and web apps like Gmail will be more nimble, and you should see a big speed increase on games and demos that previously only impressed those running Chrome or Safari. JägerMonkey is new code that works in tandem with the same TraceMonkey JavaScript code that powered previous versions of Firefox (love the naming convention, by the way) and you can read more about the change on Mozilla engineer David Mandelin’s blog. […]

Pingback from Firefox 4 beta 7 is out! | AKLP.gr
Time: November 11, 2010, 3:52 am

[…] various JavaScript benchmark test suites: Firefox 4 Performance Comparisons For more details, see Firefox Engineer David Mandelin’s blog post. Boosting Graphics Performance This update to Firefox 4 Beta incorporates hardware-accelerated […]

Pingback from Neue Firefox 4 Beta mit mehr Power » t3n News
Time: November 11, 2010, 4:08 am

[…] Jägermonkey: it’s in ur browser!!!- Blogpost des Mozilla-Entwicklers David Mandelin […]

Comment from Abhishek Dilliwal
Time: November 12, 2010, 10:02 pm

ohh great I was not knowing about the new Engine thing seems awesome!

Comment from Fanboy
Time: November 13, 2010, 9:28 am

Great job guys…am a big fan of firefox…

but it does Look like your ants demo runs slower than Chrome…thats what I felt during my test…did you guys try it out?

anyway keep the new versions coming!

Comment from KmM Tibbetts
Time: November 13, 2010, 4:58 pm

I suppose you can’t gain something without losing something, but it was disappointing to find that some of my code that runs very nimbly on firefox 3,6 takes twice the time and more memory and cpu resources in the newest beta.

Comment from jedrek
Time: November 17, 2010, 11:58 pm

Kudos to the great work! I tip my hats to all of you… CONGRATZ!!!