Saturday, March 21, 2009

Chrome Experiments

If you ever wondered how fast Google Chrome's V8 JavaScript engine is, you have to look no further. The recently launched ChomeExperiments.com has a number of computationally intensive demos written in JavaScript which will let you compare Chrome's JavaScript performance with that of your favourite browsers.

I tried out Monster on Firefox 2, Safari 3.1.1, and Google Chrome 0.4.154.


A Bit About Monster



Monster is 3D demo which uses the HTML Canvas element to render 3D animations. It starts with a square which morphs into a rotating cube which morphs into a sphere which morphs into a rotating "Monster".



Firefox 2.0.0


I wanted to see how well Monster performed in Firefox 2. Firefox showed a lot of promise as the initial square morphed to a cube and then a sphere. However, my optimism was short lived as the sphere morphed to a "Monster" and the rendering went from frames-per-second to seconds-per-frame. Saying "the demo did not perform well" would be a huge understatement.


Safari 3.1.1


The demo started a little slowly under Safari. After my experience running Monster under Firefox 2 I was expecting even less from Safari. But Safari surprised me by maintaining a low, but consistent, frame rate throughout the demo. The experience did not seem to degrade as the polygon count of the demo increased. Having said that, the performance was far from fluid.


Google Chrome


I had been disappointed by both Firefox 2 and Safari. I had seen the video clip, but I could not help wondering if it was something with the machine I was using. I fired up Chrome 0.4.154 which I had downloaded shortly after Chrome was launched. I waited as the square turned into a cube and then into a sphere and then into the "Monster" without skipping a beat.


Internet Explorer 6


We all know that Internet Explorer 6 does not have support for the HTML Canvas element, but I launched Monster in it just for the fun of it. The result? A JavaScript error. Enough said about IE!!!


Final Thoughts...


I knew Chrome was ahead of the pack in terms of JavaScript performance, but I had not realize by how much until I did a side-by-side comparison with the aforementioned browsers. I also need to try this Demo using Firefox 3, Safari 4, Internet Explorer 7, Internet Explorer 8, and Opera, but that will have to wait for now.