Monday, September 8, 2008

TraceMonkey

I do not know about you, but recently I have been hearing a lot about TraceMonkey, the Javascript engine to be released with FireFox 3.1. All news point to the promise of Javascript being propelled to a 10x faster speed. Well, I thought of giving it a try.

I downloaded the latest build of Firefox. Now I have Minefield version 3.1b1pre (It seems Minefield is the latest code name). I decided on trying out some benchmarks. I checked out the SunSpider JavaScript Benchmark.

I ran it first on Firefox 3.1b without the Tracemonkey Just In Time compiler.
Time taken: 7,572 ms.

Now I turned on Tracemonkey by opening an about:config tab and settting javascript.options.jit.content to true.

Time taken: 3,050 ms.

Not bad! I said. If not a 10x but certainly a 2.5x improvement. Not bad at all!

Curiosity set in and I tried the same test on Chrome. Time Taken: 4,919 ms. Well, Well!! The Google gang is not far behind.

I had to check out IE now. I already had IE7 on my laptop. I ran the tests. It was so slow that I had to run it again. The second time was only focussing on the tests and shutting the other applications. Hold your breath! The time taken was 57,680 ms!!!

Now this thing got me going. I have to push this to the next limit. I downloaded and installed IE8 beta and ran the tests there. Time taken is 13,224 ms.

This is truly something! I suspect another round of AJAX+ applications will hit the marketplace over next 12-18 months.

In the process of this experiments, I found another demo which was unbelievably cool. This link captures the experience: http://people.mozilla.com/~schrep/tm-image-adjustment.swf

Totally excited about Tracemonkey and carrying a bunch of Beta browsers on my machine!

Best Regards, Somnath

For those of you who are like me and want to try things for themselves:
1. Latest Nightly Build of Firefox
2. Here is the link to the benchmark: http://www2.webkit.org/perf/sunspider-0.9/sunspider.html

3. If you want to try the image manipulation demo you can try: http://people.mozilla.com/~schrep/image12.html

I could not get it working properly on IE or Chrome.