JavaScript in Google Chrome Not So That Fast

13

Posted on : 09/03/2008 | By : Jimmy Vu | In : Development News

How well JavaScript works is what I highly concern about Google Chrome — the browser on headlines of all tech news today.

The JavaScript engine embedded in Chrome, named V8, is developed by Google which implements ECMAScript 3 and can run standalone as stated on project website.

  • V8 is Google’s open source JavaScript engine.
  • V8 is written in C++ and is used in Google Chrome, the open source browser from Google.
  • V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM processors.
  • V8 can run standalone, or can be embedded into any C++ application.

Of course, we’ll have to mention the tests given out by Google itself that show JavaScript speed in Chrome  many times faster than in all other major browsers: IE, Firefox and Safari.

Google Chrome Benchmarks

Google Chrome Benchmarks

Anyway, they are tests guided by Google and I suspect that they seem be optimized toward the best of V8. So, the better way to see how good V8 perform in action is to run tests with popular JavaScript libraries like JQuery, Prototype, Dojo, Mootools, YUI which are being used in most of web applications in real world.

In a typical web application, JavaScript is mainly used for DOM selection/ manipulation rather than for heavy calculation. That’s why all libraries try to optimize DOM selection speed for (said) faster application.

To have practical view, I decided to run Mootools’ SlickSpeed tests on Google Chrome 0.2 in comparison with Firefox 3.0.1, Safari 3.1 (Windows), IE6, Opera 9.5 and especially on the nightly build of Firefox 3.1b1pre with Tracemonkey — Mozilla’s recent effort to integrate Tamarin tracing into the existing SpiderMonkey JavaScript engine — enabled and disabled. Here are the results:

Chart: Mootools SlickSpeed Test Result

Chart: Mootools SlickSpeed Test Results

SlickSpeed Benchmarks in details

SlickSpeed Benchmarks in details

(All tests were run 10 times for each browser on Windows XP SP3, AMD x64 4400+ with 2GB RAM machine)

It turns out that Google Chrome reached 6th place ahead the poor IE6 only, 49% slower than the fastest browser: Opera 9.5. Firefox 3.1 has not proved faster than the previous version in the tests, even enabling JIT engine made the results worse. (I acknowledge that it’s just pre-release beta version and Tracemonkey is not designed for optimizing DOM manipulation).

Some other conclusions we can get out from the above results (ruling out IE6 which falls far behind others in all tests) are:

Read the rest of this entry »

Recommended Reading

Data standards called crucial to patient safety: IOM calls for federal initiative.(Practice Trends)(Institute of Medicine): An article from: Family Practice NewsThis digital document is an article from Family Practice News, published by International Medical News Group on February 1, 2004. The length of the ar... Read More >
Prempro 0.45/1.5. (New & Approved).: An article from: Family Practice NewsThis digital document is an article from Family Practice News, published by International Medical News Group on April 15, 2003. The length of the arti... Read More >
Oxytrol. (New & Approved).(Brief Article): An article from: Family Practice NewsThis digital document is an article from Family Practice News, published by International Medical News Group on April 15, 2003. The length of the arti... Read More >

Turn on JavaScript JIT in Firefox 3.1

1

Posted on : 08/24/2008 | By : Jimmy Vu | In : Development News

Mozilla has just introduced a new JavaScript optimization feature to Firefox 3.1 development code base (Shiretoko) that well enhances JavaScript-based web apps performance by a 2x – 20x fold compared to the Firefox 3.0, according to JavaScript performance tests ran and published by Mozilla’s Brendan Eich.

I’m extremely pleased to announce the launch of TraceMonkey, an evolution of Firefox’s SpiderMonkey JavaScript engine for Firefox 3.1 that uses a new kind of Just-In-Time (JIT) compiler to boost JS performance by an order of magnitude or more.

Here are some of the charts from Brendan’s blog:

assorted-benchmarks

Assorted benchmarks

SunSpider micro-benchmarks

SunSpider micro-benchmarks

However the best way to evaluate it is to see it in action via simple JavaScript image editor that lets you adjust a picture’s contrast and brightness with a couple of sliders created by Mike Schroepfer. By default, TraceMonkey is disabled (as it is still buggy), there is a very noticeable delay while sliding. Turn it on (javascript.options.jit.content = true in about:config) and the thing works like charm, very smoothly.

JavaScript Image Editor

JavaScript Image Editor

Going into significant detail on how all of this came about, Brendan notes some key points:

Read the rest of this entry »

Recommended Reading

Plan to redirect Academic Health funds slammed: reaction to IOM report.(Practice Trends): An article from: Family Practice NewsThis digital document is an article from Family Practice News, published by International Medical News Group on October 1, 2003. The length of the art... Read More >
Prempro 0.45/1.5. (New & Approved).: An article from: Family Practice NewsThis digital document is an article from Family Practice News, published by International Medical News Group on April 15, 2003. The length of the arti... Read More >
Is carotid stenting primary treatment for extracranial carotid artery disease?(PRO & CON): An article from: Internal Medicine NewsThis digital document is an article from Internal Medicine News, published by International Medical News Group on January 1, 2005. The length of the a... Read More >