Each of these engines seem to have unique features. V8 has what are called 'hidden class transitions' which are simply class definitions inferred at runtime. As class definitions change infrequently, this means that V8 has very fast class member lookup. TraceMonkey uses a novel technique called Tracing. Instead of compiling a method 'just in time' and then executing the compiled machine code, TraceMonkey interprets everything up until it detects a loop. At this point, it will compile the loop. So whereas traditional JIT compiling will compile code which potentially never gets run, Tracing will only ever compile code that gets run. Webkit's SFX has borrowed a trick from .Net and will compile any regular expressions into machine code. Their Webkit Regular Expression Compiler (WREC) is why SFX beats everyone else hands down on regular expression performance.
It has been a hectic 2 weeks. In that time, there have been various claims that first TraceMonkey was the fastest. Then V8 claimed they were the fastest. And over the past couple of days there have been claims that Webkit's SFX is the fastest. So who is right? Well, many factors are involved, and all three engines are still very much in active development. So the lead could shift around yet again.
The headline figure is:
Webkit (ie Safari) nightly builds are 46% faster than Firefox nightly builds. Chrome is 7% faster than Firefox.
However, the above statement does not give the whole picture. It appears that Safari's SFX JIT is not fully enabled on Windows. Recent Webkit checkins indicate that the Windows JIT is still being worked on. As Chrome is currently a Windows-only browser, it is impossible to compare Webkit-SFX with Chrome. Therefore, the 46% figure advantage Webkit has over firefox was obtained on OSX 10.5.
Benchmark: Sunspider 0.9
Windows XP SP2 results (Core2 Duo, T7300/2Ghz)
Chromium: 2747.8ms +/- 2%
Firefox: 2941.4ms +/- 4.3% (1.07x as slow)
webkit: 3124.6ms +/-3.3% (1.14x as slow)
OSX 10.5.4 results (Core2 Duo, 2.8Ghz)
Firefox: 1361ms +/- 2.7%
webkit: 931ms +/- 2.3% (1.46x as fast)
Browsers used were the latest nightlies:
Win32 Firefox 3.1b1pre Gecko/20080910043000 (Content JIT=on)
OSX Firefox 3.1b1pre Gecko/20080910020330 (Content JIT=on)
Webkit r36309 using Squirrelfish-Extreme (SFX)