Blog Archives

Last night I decided to try the performance of the new TraceMonkey feature. TraceMonkey is an improvement to Mozilla’s SpiderMonkey JavaScript engine, which enables JIT optimizations to SpiderMonkey, which means that the engine optimizes the parts of your JavaScript code which run repeatedly (e.g., loops). For more information on TraceMonkey, check out Brendan’s announcement of TraceMonkey. I gave Mozilla’s Dromaeo, Webkit’s SunSpider, and Google’s V8 Benchmark Suite a try, and the results follow.

Dromaeo. Dromaeo is Mozilla’s JavaScript benchmark suite, which mainly consists of some of the SunSpider tests. For a background on Dromaeo, see here. It took 7108.80ms to run the entire suite on Firefox 3.1b1pre without TraceMonkey enabled, and 6920.80ms with TraceMonkey enabled. The TraceMonkey version of the test was a tiny bit more faster, but nothing to get exceited about. The exact details can be viewed here, with the left hand column being the test run without TraceMonkey.

SunSpider. SunSpider is Webkit’s JavaScript benchmark suite. For a background on SubSpider, see here. SunSpider without TraceMonkey ran in 2953.6ms, but after turning TraceMonkey on, SunSpider ran in 1772.8ms (which is 1.67 times faster)! You can compare my result with and without TraceMonkey to judge for yourself.

V8 Benchmark Suite. V8 Benchmark Suite is Google’s JavaScript benchmark suite which was recently released, with the release of the V8 engine. This page provides a simple explanation of their suite. V8 Benchmark was exceptional in that turning on TraceMonkey actually made it run slower, from a score of 183 without TraceMonkey down to 168 with TraceMonkey. I’m not sure exactly how these scroes can be compared though.

You can try to run these tests for yourself. All you need is a recent Firefox 3.1 build, and changing a small preference to turn TraceMonkey on. I’m very curious as to where the TraceMonkey project is headed, and what further optimizations we can expect, so this will be an intriguing progress to follow.