Chrome's V8 vs. TraceMonkey

TraceMonkey is a new virtual machine for Firefox 3.1. It's a big improvement since it will add JIT compilation, something that normally improves performance at least 10 times [for the record Java's HotSpot VM that supported JIT improved Java's performance around 20x times].

V8 is a new virtual machine used in Google Chrome and one of the interesting parts is that it does not support JIT, it simply compiles all JavaScript directly to machine code. I think the main reasons why they do this are following:

  • a page's JavaScript code is rather small, no need to worry about too much code
  • they always have source code available, no point in converting it to byte code

The bottom line is that TraceMonkey will only compile parts of the JavaScript, while V8 compiles all the JavaScript. What is best? For the current web, I think V8's approach is far better and I can't see how TraceMonkey's JIT approach would beat V8 (at least the compilation part, they could beat it on other fronts, for example by doing some smarter optimizations).

Another advantage I think V8 has over TraceMonkey is a very good garbage collector.

More about V8's design can be read here:

Code · JavaScript 4. Sep 2008
© Amir Salihefendic. Powered by Skeletonz.