On July 12th, JägerMonkey officially crossed TraceMonkey on the v8 suite of benchmarks. Yay! It’s not by a lot, but this gap will continue to widen, and it’s an exciting milestone.
A lot’s happened over the past two months. You’ll have to excuse our blogging silence – we actually sprinted and rewrote JägerMonkey from scratch. Sounds crazy, huh? The progress has been great:
The black line is the new method JIT, and the orange line is the tracing JIT. The original iteration of JägerMonkey (not pictured) was slightly faster than the pink line. We’ve recovered our original performance and more in significantly less time.
What Happened…
In early May, Dave Mandelin blogged about our half-way point. Around the same time, Luke Wagner finished the brunt of a massive overhaul of our value representation. The new scheme, “fat values”, uses a 64-bit encoding on all platforms.
We realized that retooling JägerMonkey would be a ton of work. Armed with the knowledge we’d learned, we brought up a whole new compiler over the next few weeks. By June we were ready to start optimizing again. “Prepare to throw one away”, indeed.
JägerMonkey has gotten a ton of new performance improvements and features since the reboot that were not present in the original compiler:
- Local variables can now stay in registers (inside basic blocks).
- Constants and type information propagate much better. We also do primitive type inference.
- References to global variables and closures are now much faster, using more polymorphic inline caches.
- There are many more fast-paths for common use patterns.
- Intern Sean Stangl has made math much faster when floating-point numbers are involved – using the benefits of fat values.
- Intern Andrew Drake has made our JIT’d code work with debuggers.
What about Tracer Integration?
This is a tough one to answer, and people are really curious! The bad news is we’re pretty curious too – we just don’t know what will happen yet. One thing is sure: if not carefully and properly tuned, the tracer will negatively dominate the method JIT’s performance.
The goal of JägerMonkey is to be as fast or faster than the competition, whether or not tracing is enabled. We have to integrate the two in a way that gives us a competitive edge. We didn’t do this in the first iteration, and it showed on the graphs.
This week I am going to do the simplest possible integration. From there we’ll tune heuristics as we go. Since this tuning can happen at any time, our focus will still be on method JIT performance. Similarly, it will be a while before an integrated line appears on Are We Fast Yet, to avoid distraction from the end goal.
The good news is, the two JITs win on different benchmarks. There will be a good intersection.
What’s Next?
The schedule is tight. Over the next six weeks, we’ll be polishing JägerMonkey in order to land by September 1st. That means the following things need to be done:
- Tinderboxes must be green.
- Everything in the test suite must JIT, sans oft-maligned features like E4X.
- x64 and ARM must have ports.
- All large-scale, invasive perf wins must be in place.
- Integration with the tracing JIT must work, without degrading method JIT performance.
For more information, and who’s assigned to what, see our Path to Firefox 4 page.
Performance Wins Left
We’re generating pretty good machine code at this point, so our remaining performance wins fall into two categories. The first is driving down the inefficiencies in the SpiderMonkey runtime. The second is identifying places we can eliminate use of the runtime, by generating specialized JIT code.
Perhaps the most important is making function calls fast. Right now we’re seeing JM’s function calls being upwards of 10X slower than the competition. Its problems fall into both categories, and it’s a large project that will take multiple people over the next three months. Luke Wagner and Chris Leary are on the case already.
Lots of people on the JS team are now tackling other areas of runtime performance. Chris Leary has ported WebKit’s regular expression compiler. Brian Hackett and Paul Biggar are measuring and tackling what they find – so far lots of object allocation inefficiencies. Jason Orendorff, Andreas Gal, Gregor Wagner, and Blake Kaplan are working on Compartments (GC performance). Brendan is giving us awesome new changes to object layouts. Intern Alan Pierce is finding and fixing string inefficiencies.
During this home stretch, the JM folks are going to try and blog about progress and milestones much more frequently.
Are We Fast Yet Improvements
Sort of old news, but Michael Clackler got us fancy new hovering perf deltas on arewefastyet.com. wx24 gave us the XHTML compliant layout that looks way better (though, I’ve probably ruined compliance by now).
We’ve also got a makeshift page for individual test breakdowns now. It’s nice to see that JM is beating everyone on at least *one* benchmark (nsieve-bits).
Summit Slides
They’re here. Special thanks to Dave Mandelin for coaching me through this.
Conclusion
Phew! We’ve made a ton of progress, and a ton more is coming in the pipeline. I hope you’ll stay tuned.
This is great news! I can’t wait for this to land.
IMO the best solution for tracing would be to *not* instrument the code, but instead to record what you are executing everytime there’s an interruption and rely on probabilities. It’s very fast to see what part of your code east a lot of CPU, it’s the one that’s constantly running when you’re interrupted.
In other words, go oprofile ( oprofile.sourceforge.net ) not gnu gprof.
Great stuff, Kudos :)
Do you know if there’s a plan to merge the fatval branch back to tracemonkey? and if so when? :)
I hardly understand any of this really, but it sounds very very good! Can’t wait for Firefox 4!
Great News, there are A LOT to be done. Especially when Mozilla is SO behind in terms of JS performance. But it is great that Mozilla is having nearly a dozen of people working on JS performance alone.
jmdesp: The way tracing works is it must precisely observe behavior, in order to know what code to generate. It’s tough to do that at a rough granularity while having features like method inlining.
What we can try (and want to experiment with in the future) is something like this though. By capturing higher-level data across more iterations of a loop, we can decide how to trace it better. Brian Hackett is working on an awesome type inference framework which could really pave the way for more parametrized compilation granularity.
Barak: Yeah, for sure! That’s supposed to happen this week.
Thanks for your post, I follow JM and TM development quite closely but it’s still interesting to see a summary of what happened over the last months.
One question though. What does this tell us about TM, if JM can already outperform it on many benchmarks? Is TM unable to JIT some important constructs? Does it not trace enough code? Or is the interpreter too slow? It would be interesting to get your opinion on that.
Anyway, great work so far! I’m looking forward to the next posts and performance improvements…
Jan: TM can only JIT loops, and it’s best at loops that don’t have too much control flow or whacky things like eval() going on. The interpreter is indeed very slow – JM will (for the most part) replace it, giving us a better baseline.
TM and JM beat each other on different benchmarks, which is a good sign. We can use JM for generally good performance, and drop into TM where we know it’ll win even more.
Awesome work guys!
Was confused by this sentence though:
“All large-scale, invasive perf wins must in place.”
Is there a missing word? I’m not understanding it.
Fantastic news guys, very much appreciated.
You could test your ideas aginst a real world issue if you want ;-)
Bug 559396 – Large ShelveLogger files are slow in Firefox .
(bzip2-compressed instrumented version that alerts times and has profiler hooks, available).
Here: https://bugzilla.mozilla.org/show_bug.cgi?id=559396
What software did you use to create the chart ?
Mark: missing word is “be” – thanks, fixed.
SilverWave: [EDIT] – Looks like this bug is not gated on JS perf.
GavinB: It’s a screenshot from http://www.arewefastyet.com/ which uses the “flot” JS library.
The hovering deltas could do with using something like clueTip (http://plugins.learningjquery.com/cluetip/) – when you hover over the most recent points, it spills off the right of the page and doesn’t render well. Would be nicer if it hung left of the point when the point is close to the edge.
Ed: Think that FF4 is not just about having the best JIT in class. FF3 worked (more or less) as Java Hotspot and did it a great job. Even is in between 2x and 5x slower than other JITs, is not slow for this reason. FF4 also improved and it will improve not only in JS times, but also in accelerating the drawing using Direct2D on Windows (and similar frameworks on other platforms), better layout performance. So you will feel it faster. Having a great architecture for improvement as is Jaeger Monkey, will just mean that even if FF4.0 will not be amazingly fast, will offer a good baseline to start on. Also the architecture changes will mean just what JM states: will offer no “worst cases” where FF4 will be 5x times slower because it mostly stay in an interpreter. So for me is just amazing that Mozilla team always prove that can innovate and impress with that great quality products that all try to copy (extensions, themes support, very fast JS, accelerated frameworks – started by using Cairo from FF3.0, low memory usage, great standard support: Acid 3 is 94/100 which is a great score!). So go on Mozilla, go and prove that you are great!
Hi, great job!! throwing away the last version and rewriting JägerMonkey from scratch was the best decision… If only more developing teams around the world were these brave…
Is there anything than us firefox 4 beta testers can do to help you with this?
I hardly understand any of this really, but it sounds very very good! Can’t wait for Firefox 4!
Oh.
oakley サングラス 激安
What’s Happening i’m new to this, I stumbled upon this I’ve found It absolutely valuable and it has aided me out loads. I hope to contribute & help other people like its helped me. Great career.
Observers maintain the item displays a new coherent approach, one thing thus low in your culture,
that it’s not necessarily realised by simply all. This will allow you to answer only those calls that come in on your
forwarded toll free number and route other calls to different locations.
You need to make your potential customers aware of your products and services to ensure that they recognize them as valid solutions to their everyday problems.
Here is my web page; Google
Great goods from you, man. I have understand your stuff
previous to and you are just too great. I really like what you’ve
acquired here, really like what you’re saying
and the way in which you say it. You make it entertaining and
you still take care of to keep it sensible. I can not wait to read
far more from you. This is actually a great website.
I’ve been exploring for a little bit for any high quality articles or
weblog posts in this kind of area . Exploring in Yahoo I at last stumbled upon this web site.
Studying this info So i’m satisfied to exhibit that I’ve an incredibly just right uncanny feeling I
discovered exactly what I needed. I most indubitably will
make certain to don?t overlook this web site
and give it a look regularly.
hi!,I love your writing very much! percentage we be in contact extra about your post on AOL?
I need an expert in this space to resolve
my problem. May be that’s you! Taking a look forward to see you.
excellent post, very informative. I ponder why the other experts of this sector do not understand this.
You must proceed your writing. I am sure, you have a great readers’ bae already!
Sooner or later, Google will find all new spam methods.
* Let you know there are things you can do to improve y0ur ranking.
And then on March 20, the world’s largest paid private blog network – BMR
– announced that its vast network had been almost entirely de-indexed
by Google, causing chaos in the internet
marketing industries.
excellent points altogether, you just received a logo new reader.
What may you suggest about your publish that you made a few days ago?
Any positive?
I’ve learn several just right stuff here. Definitely worth
bookmarking for revisiting. I wonder how so much attempt
you put to make one of these great informative website.
I’ve been exploring for a little for any high quality articles or weblog posts in this sort of house .
Exploring in Yahoo I ultimately stumbled upon this website.
Reading this info So i am satisfied to exhibit that I have a very just right uncanny feeling I came upon just what I needed.
I so much indisputably will make certain to don?t forget this website and provides it a look regularly.
Hurrah! After all I got a weblog from where I be capable of in fact obtain helpful facts concerning my study and knowledge.
Superb, what a website it is! This web site gives useful information to us, keep
it up.
Just wish to say your article is as astonishing.
The clarity in your put up is simply nice and i could suppose you’re a
professional in this subject. Well together with your permission let me to clutch your RSS feed to stay updated with impending post.
Thank you 1,000,000 and please continue the gratifying work.
You ought to take part in a contest for one of the best websites on the
web. I most certainly will recommend this website!
Thanks for the auspicious writeup. It if truth be told was once
a enjoyment account it. Look complex to far brought
agreeable from you! However, how can we be in contact?
Thank you for every other informative blog. The place else may I get that kind of info written in such a perfect means?
I have a venture that I am simply now operating on, and I’ve been on the look out for such information.
Excellent pieces. Keep writing such kind of information on your site.
Im really impressed by it.
Hello there, You’ve performed an excellent job. I will definitely digg
it and in my view recommend to my friends. I am
sure they will be benefited from this web site.
Great blog here! Additionally your website loads up very fast!
What host are you using? Can I get your associate hyperlink on your host?
I want my web site loaded up as fast as yours lol
Thank you a bunch for sharing this with all of us you actually
know what you’re speaking approximately! Bookmarked.
Kindly also consult with my site =). We will have a link trade arrangement between us
Very soon this website will be famous amid all blog people, due to it’s pleasant articles
It’s really very difficult in this active life to listen news on Television, therefore
I only use the web for that purpose, and get the most up-to-date information.
Awesome blog you have here but I was curious if you knew of any message boards that cover the same topics talked about in this article?
I’d really like to be a part of community where I can get responses from other knowledgeable people
that share the same interest. If you have any suggestions, please let me
know. Appreciate it!
I do not even know the way I finished up right here, however I assumed this post was great.
I do not recognize who you might be however certainly you’re going to
a well-known blogger in the event you are not already.
Cheers!
This is my first time pay a visit at here and i am in fact happy to read everthing at one place.
Asking questions are truly pleasant thing if you are not understanding anything entirely, except this article gives
nice understanding even.
Howdy very nice blog!! Man .. Beautiful ..
Superb .. I will bookmark your website and take the feeds additionally?
I am glad to find numerous helpful info here within the submit, we want work out more strategies
in this regard, thank you for sharing. . . . . .
I was suggested this web site by my cousin. I am not positive whether or not this submit is written by him as no one else recognise such
distinctive about my trouble. You are amazing! Thank you!
It is in reality a nice and useful piece of information. I am
glad that you simply shared this helpful info with us.
Please stay us informed like this. Thank you
for sharing.
I go to see every day some web sites and sites to read articles, but this website offers quality based content.
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across. It extremely helps make reading your blog significantly easier.
Good post! We are linking to this great content on our website.
Keep up the good writing.
Name it nonetheless yyou need however reality is, that you
want to have some extra money and gold in your Pixel Gun 3D Account.
my webpage pixel Gun 3D hack 10.0.0
Then she notices, without sharing our pain; and in the children’s books were the death cure pdf about the admin involved in a way that thatcherite ideas
gradually seeped into our ken. For nicolson makes the reader dives without a toehold on the subject of love, and there are distinctions to be said of charles darwin’s ideas on to bed,
handcuffs, rope.