A few days ago, the Google announced a beta version of their web browser, called “Chrome”.
So, I guess people started wanting more from their Web apps. And there are two strong contenders.
(Click the image to read the full article)
On the other hand, the SquirrelFish from the WebKit adopted bytecode compilation and technique similar to the “trace tree”. (Same link to the above link for the WebKit. ) You can see how fast it is compared to is predecessor from this picture.
I did NOT read the paper on the “trace tree”, so I’m not sure how much different the techniques used for the SquirrelFish and the TraceMonkey. If anyone read it and compared them, please post what the differences are.
Now, it is time for the Chrome’s V8.
So, unlike the SquirrelFish, it is compiled to the native code. Therefore it should be faster than the SquirrelFish. It also uses other technique : Fast Property Access, Efficient Garbage Collection
How fast is the V8? Let’s take a look at it.
(The unit is in ms. So, the shorter is better)
( The longer is better )
( The unit is in ms. So the shorter is better. )
What is interesting here is that Wayne used FireFox 3.1 Nightly [1.9.1b1pre/200809020331. According to his test, the V8 is faster. But in a mozillazine’s blog, it says the other way.
But even at the MozillaZine’s blog, it points out the cases which is slower than the V8.
According to this article, the Mozilla will be 7x faster in the end.
So, they share something common that they are not based on interpreters anymore. VM can be thought as a better interpreter, but…. anyway.. Especially the TraceMonkey, i.e. TM, shares lots of things with the SquirrelFish.
Many of you will think that the TraceMonkey and the V8 are in native code, while the SquirrelFish is in bytecode, so the SquirrelFish is slower. Well.. yeah.. I think so. But probably the SquirrelFish can be faster in the long run. I guess there is reason Apple inc chose the SquirrelFish. In the next version of the Mac OS X, so called the Snow Leopard, more dynamic execution of code will be incorporated, called “Grand Central”. Also, to enhance security in the code and to adapt the performance more to specific cases, the execution of the binary code will be dynamically changed. For example, if clause’s execution path can be different under different cases, even though the whole if.. else.. block is same. So, implementing it in bytecode can have more potential in dynamical executed environment. So, we can’t conclude which approach is better yet.
(How about the Linux? Will it have similar technology like the Grand Central? )
By the way, don’t forget that you can use the WebKit as a HTML engine while you can choose the SquirrelFish or the V8, as the Google does for its Chrome browser. ( Yeah.. in your code, you can use the WebKit, SquirrelFish and the V8 in your codes! )
Currently, the Google advertised the Chrome more well than the Mozilla Firefox 3 and the WebKit. So, people are amazed by the Chrome performance, although they use very similar techniques and its performance is similar to those of others. This is the power of marketing or using journalism!