Tuesday, September 2nd, 2008

Google Chrome, Chromium, and V8

Category: Browsers, Google

>It is really exciting to see the level of pace that browsers have been setting recently, especially with respect to performance.

I have been able to keep in sync with Google Chrome the new browser, and Chromium, the open source code-base it comes from. There are a couple of innovations that have been great to see such as the multiple process model for tabs and windows, the unified tab and search functionality, and at the core, V8.

V8 is the super-speedy JavaScript VM by Lars Bak of Sun HotSpot fame. When you run JavaScript benchmarks on this puppy, you see very speedy responses indeed. The V8 part of the comic says it well:

The breakthrough of having hidden classes to look at structures and work out the shared information (e.g. object Foo looks like a Person). Once you have that data, you can optimize in the same way you would class systems. V8 improvements consist of:

  • Compiler: Instead of using interpretation, JavaScript gets compiled down to native code
  • Inline caching: Optimize for accessing, and function calling
  • Very efficient memory management system

What version of JavaScript? “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.”

If you are interested in the benchmark suites, you can run them and check them out.

Some of the core technology is also exciting to geeks. For example, as this code is operating system neutral we use the Skia Graphic Library (SGL) used by the Android team.

What about the process manager? John Resig has interesting thoughts on that with the rub: “The blame of bad performance or memory consumption no longer lies with the browser but with the site.”

Alex Russell also has some good thoughts on the importance of Chrome, and Christopher Blizzard (Mozilla) also has some thoughts on how this shows the browser market is strong.

This is all great to see. Not only is this just the beginning for Google Chrome, Chromium, and V8 (I am dying for a Mac version!), but the other browsers are keeping pace too. The end result is a better Web for users, and a higher quality of product for developers to build against!

Related Content:

Posted by Dion Almaer at 2:00 pm
49 Comments

++++-
4.5 rating from 60 votes

49 Comments »

Comments feed TrackBack URI

Browser sniffing rox!

Comment by beemr — September 2, 2008

>>Compiler: Instead of using interpolation, JavaScript gets compiled down to native code

You mean “interpretation” right?

I’m curious. We have a 5th major browser now. How does Chrome appear to jQuery and the other libraries that make allowances for the various browsers and their bugs?

Comment by Nosredna — September 2, 2008

I hope I didn’t miss anything, but how does V8 stack up against TraceMonkey or SquirrelFish?

Comment by antimatter15 — September 2, 2008

I just downloaded and installed Chrome. My first impressions are good (from a very non-technical point of view). The layout is nice and simple…and it feels very fast.

Comment by Jonny — September 2, 2008

@antimatter15: its at least as fast as TraceMonkey, but sometimes up to 10x

Comment by rethinker — September 2, 2008

I’ve had 3 lockups in the few moments I’ve tried it out.

Comment by jakec — September 2, 2008

It needs a proxy option or needs to use the native internet connection settings. Can’t install it from work. :(

Comment by bkim — September 2, 2008

Downloaded Chrome and run a non-trivial web app (an Ajax Gantt diagramming tool, with complex scheduling and layout algorithms in JavaScript). Worked as well as Safari, probably faster (hard data to come).

Chrome is a new kind of browser, it is a WebOS platform. Will ignite some more competition for mind (and market) share. More about this Google OS in my blog: http://www.pannonrex.com/2008/09/02/google-chrome-the-google-os/.

Comment by piprog — September 2, 2008

In the V8 benchmark suite, I got 141 in Firefox 3 and 2473 on Chrome. So V8 is ~17.5x faster than SpiderMonkey (not TraceMonkey).

In SunSpider, I got 1489.4 on Chrome and 9622.8ms on Firefox 3 (not TraceMonkey). But it still looks like V8 is likely a lot faster than TraceMonkey as well.

Comment by antimatter15 — September 2, 2008

hi there,

I am leaving the comment right now in chrome. But ajaxian does not render properly in chrome. Many other sites which have images are NOT drawing properly on chrome.

However, since it’s beta, it’s OK. I look forward to an IDE with debugging capabilities for javascript/css on chrome soon.

The “Task Manager” looks good. I’m used to having 50-100 tabs on Firefox at any given point of time. That won’t scale well on Chrome since each Tab consumes a 2 threaded Process. So, right now I am keeping Firefox as the default browser.

proxy option : I am behind IIS’s web proxy and was able to download and install chrome just fine (since it could get hold of my IE proxy settings).

BR,
~A

Comment by anjanb — September 2, 2008

My favorite Dojo toolkit doesn’t seem to like Chrome :-( Some of the Dojo demos (such as Fish Eye) on DojoToolkit.org are not showing up correctly. The headache of supporting yet another browser is already giving me some chills.

Comment by Rags — September 2, 2008

I benchmarked Chronoscope (my intense charting library) on Chrome (http://timepedia.blogspot.com/2008/09/google-chrome-smokes-competition-on.html) and it’s roughly 2x SquirrelFish/TraceMonkey. Chronoscope is numerically intense as well as does a lot of datastructure traversal, DOM manipulation, and canvas draws.

Comment by cromwellian — September 2, 2008

I tried it on the heaviest web app I’ve written so far, that contains a ton of javascript, and the application was actually snappy for the first time, well, pretty much ever. Oh, and it worked fine despite the fact that I’ve never actually targetted safari. Nice job google!

I’m also fond of the interface. Simple, but efficient. Their web inspector tool is nice (but nowhere near firebug ofcourse). The only question mark is the bookmarking functionality. The organization and placement of the menu is a bit too different for my tastes.

Comment by Joeri — September 2, 2008

After some SunSpider benchmarking (I posted that on kourge.net as well), it seems that V8 blows all the other JS engines away in most cases. Only TraceMonkey seems to come even a bit close to V8, but TraceMonkey crashed in one of the benchmarks so I couldn’t get the raw numbers.

Comment by kourge — September 2, 2008

Resig’s Dromaeo performance tester really shows that Chrome shines, too.

I get a 3126.60 total in FF3 and a 710.40 in Chrome. That’s got to make Mozilla eager to get their new JS code into FF as soon as possible.

Anyone have any really good DOM tests?

Comment by Nosredna — September 2, 2008

I did my own testing with production browsers (IE7, Safari 3.1, Firefox 3.0, and Opera 9.52). In JavaScript Chrome is king: 6.7x faster than the second best, and 42x faster than IE(!). Graphics performance (SVG, Canvas) seems to be more even.

The details are @ http://www.pannonrex.com/2008/09/03/shining-chrome-browser-speed-tests/

Comment by piprog — September 2, 2008

Look at V8 the performance numbers and graphs. It is amazing.. Chromes blows away the competition

http://monitor20.blogspot.com/2008/09/chrome-blows-aways-safari-ie-and.html

Comment by starthere — September 2, 2008

You can poke around Chrome’s DOM with Firebug Lite. Any other debugging tools work?

Comment by Nosredna — September 2, 2008

I just noticed something REALLY interesting.
Chrome seems to give preference over Flash Video rendering than anything else in the page including javascript.

I tested a site which I have made last year which has video playing and lots of JS interface stuff. The video NEVER stutters but you notice the js or page scrolling sometimes slow down to accommodate the video.

The result is the opposite in all other browsers including Safari 3.
All I can say is this is a really nice Video Playback browser.

It comes with Flash when you install it too! :)

*cough* YouTube!

Comment by samuraixp — September 2, 2008

@rags – I just checked Dojo 1.2b1 in chrome, and [specifically] the Fisheye variants were working just fine. All but two (related) unit tests pass out of the box as well. I’ve noticed it does a horrible job of rendering -moz-border-radius / radius: css properties, and has some weird aliasing issues with opacity, but it’s beta, so we’ll see … I too am slightly saddened by yet another browser to consider in our test matrix, but ‘such is life’. Thankfully, it is not yet considered a major browser so all the libraries will have ample time to test and report issues.

Comment by phiggins — September 2, 2008

I’m impressed. My first thought was uh oh, here is another browser that I am going to have to write conditionals for, but with no conditionals at all everything seems to work in the dev version of MochaUI, and effects animation is very smooth.
.
Square bullets are a little misshapen, and if you set the opacity on a div to less than 100% that is containing a canvas that has elements with opacity less than 100%, those canvas elements become opaque white. This is just the opposite of a similar bug in IE7 where the elements become opaque black. But for a first release, only finding a couple cosmetic bugs in a fairly complex application is refreshing.
.
Can’t say much for the GUI, but that seems to be Google’s signature, ugly as hell, but fairly simple and functional UI design. The GUI sort of looks like something a grade school kid might have cut out of posterboard. Compare to Firefox on the Mac which is my favorite browser GUI at the moment. At least Chrome doesn’t look as awful as Gmail.

Comment by GregHouston — September 2, 2008

V8 is the Michael Phelps of Javascript engines!

Comment by Mink — September 2, 2008

>>*cough* YouTube!
.
Did you work on youtube? Is that what you’re trying to not tell us? :-)
.
>>Thankfully, it is not yet considered a major browser so all the libraries will have ample time to test and report issues.
.
Supposedly, Chrome fails only two of the jQuery unit tests as well.

Comment by Nosredna — September 2, 2008

Can’t use it from my office. Something wrong with the proxy?

Comment by arphen — September 2, 2008

On my app, Chrome wins by about 2x over the latest TraceMonkey, but this may be due to issues outside of JS execution speed, such as DOM manipulation speed and GC/object allocation.

Comment by cromwellian — September 3, 2008

cromwellian: we’re not tracing the DOM yet. But we will. How do I run your app? Thanks,

/be

Comment by BrendanEich — September 3, 2008

Brendan, I don’t currently have a runnable benchmark that others can use (I run from inside GWT), but I will produce a public version soon as non-obfuscated JS. I notice that the text-rendering code (emulates drawing text on Canvas via absolutely positioned DIVs) soaks up a good junk of CPU when profiled in Firebug, so it may be the case that changing this to mozDrawText would help alot.

Comment by cromwellian — September 3, 2008

I too was intrigued whether or not v8 would outperform tracemonkey or squirrelfish. I benched them against webkit’s sunspider and mozilla’s dromaeo as well as chrome’s own suite. Results here:

http://waynepan.com/2008/09/02/v8-tracemonkey-squirrelfish-ie8-benchmarks/

I threw in IE8 for laughs, and indeed there are laughs to be had ;)

Comment by waynep — September 3, 2008

Tested on my windows xp, and every page i went to i got a lockdown. Even google.com didn’t work.. ._.’

Comment by V1 — September 3, 2008

What about privacy? Ads & co.
Did you guys read the licence?

Comment by Spir — September 3, 2008

A good, or bad part ( depends how u see it)
Is that chrome updates the browser SILENT, this means people can not stop the update.. Some people will hate that, but us developers will not have to struggle wit out of date browsers?

http://www.google.com/support/chrome/bin/answer.py?answer=95414&query=update&topic=&type=

Comment by V1 — September 3, 2008

Excellent browser but a lot of AJAX sites will have to adapt. The bad thing about it is that it lacks a good javascript debugger. Firebug for Firefox is decent but Chrome’s debugger is awful. I hope they improve that part in the next version to help AJAX developers.

Comment by alexbf — September 3, 2008

>>Firebug for Firefox is decent but Chrome’s debugger is awful.
.
How do you run Chrome’s debugger? I’ve been using Firebug Lite in it.

Comment by Nosredna — September 3, 2008

Oh crap never mind. I guess I hadn’t REALLY looked through the menus.
.
Yeah, that’s crap alright. Can you set a breakpoint?

Comment by Nosredna — September 3, 2008

You can type help on the debugger console to get more info, and yes you can set breakpoints. I suspect that they plan to improve the GUI for this feature later on, and it’s not where they should put their priorities imho.

Their page load profiler tool is pretty buggy also, but it shows promise.

Comment by Joeri — September 3, 2008

>>I suspect that they plan to improve the GUI for this feature later on, and it’s not where they should put their priorities imho.
.
I’m curious. Why do you think that? I think part of Firefox’s recent success comes directly from the fact that developers tend to “sit” in Firefox because of Firebug. Thanks to Firebug, every other browser becomes a “port” or a nuisance.
.
If Chrome ends up with a better debugger than Firefox, then it will become “home” to the developer. That’s the only way programmers will be interested in supporting its extras.
.
Do you think that the debugger is low priority because Chrome has done such a good job of working so well on so many sites (very impressive).
.
Or are you thinking that it’s a bit rough around the edges in general and really needs to come up to speed for the user before the developer is accommodated? (For example I’m in Chrome now. It’s telling me to correct “accomodated,” via red squigglies, but there’s no alternative suggested when I right-click. Also, if I hit the back arrow a bunch of times, Chrome just friggin’ disappears!)

Comment by Nosredna — September 3, 2008

[shameless_plug]
To all those with problems getting their sites/libraries working with Chrome you might want to read this; http://ra-ajax.org/google-chrome-ajax-the-open-web-and-open-standards.blog
[shameless_plug]
.
Now when that’s said I *think* that this is GREAT news, and obviously something G will focus a LOT on (saw it on their landing page at google.com for download among other things)
I just hope it stays in the spirit of the Open Web and don’t creates a lot of EEE features…
This can be the “make it or break it” time in history for both G and the Open Web…

Comment by ThomasHansen — September 3, 2008

HEre’s another one about the “whys”;
http://ra-ajax.org/google-chrome-and-why-google-built-it.blog

Comment by ThomasHansen — September 3, 2008

I’d like to know how Chrome is handling processes and tabs. Right now I have 76 open tabs. Chrome is using 22 processes to run those tabs. The comic/documentation made it sound like each tab would run in it’s own process.

Has anybody found specific documentation on this?

Comment by erikweibust — September 3, 2008

@Nosredna
I do think it’s rough around the edges, yes, and I think they need to make it a good browser for the end user before they make it a good browser for the developer. I also think that developers aren’t going to sit in chrome like they sit in firefox, even with a better debugger, due to the lack of add-ons. Firebug by itself is nice, but I combine it with a number of different add-ons: yslow, firephp, remove cookies for this site, html validator, and a few other ones. Even if google made the debugger a priority, they wouldn’t outshine the full firefox dev environment without a lot of community involvement.
.
I think you also overestimate the influence of a good debugger on browser support. Coming from the corporate environment I’ll tell you that the primary driver for which browsers to support is which browsers are installed at the customer. In practice, we’re talking about IE, and a sprinkling of firefox. What chrome needs for corporate adoption is support for group policies for central management, msi for central deployment and ntlm for single authentication. It’s got ntlm support, but its installer and update mechanism are unacceptable for corporate use, and I have no idea how well it blends with group policies. Without corporate marketshare, it’s not going to see much support in commercial web apps, regardless of how much developers like it.

Comment by Joeri — September 3, 2008

Dion, FYI the breakthrough of hidden classes is not distinct to V8. SpiderMonkey has had the property tree for something like six years, and shape-based polymorphic caching (need to blog about this in detail, Mason made a good try but it’s a deep topic) since Firefox 3 (early this year).

Guess I need a new PR agency — no one did a comic book when I sweated these details a year or six ago :-P.

/be

Comment by BrendanEich — September 3, 2008

@Brendan
Go dude…! :)
How much I think that Chrome can reach those last piece of IE6 (and maybe even IE users in total) and thereby making my life actually physically far better. I still cheer for you guys ;)
And I really hope that this is “not it” in regards to the Fox…

Comment by ThomasHansen — September 3, 2008

Brendan,
.
I try to read everything you say, so keep talking. But yeah, Google’s use of the comic book was incredibly helpful for the buzz it created.

Comment by Nosredna — September 3, 2008

I wish someone could explain to me why this great V8 engine chokes on this simple code:
.
(function blah() {
test = setTimeout(blah,25);
})();
.
My open source projects use that pattern *alot* and almost every instance of it in my code fails with a “ReferenceError” on the setTimeout line saying that the “blah” function is undefined. However, “blah” is the currently executing function!

Comment by shadedecho — September 3, 2008

@shadedecho,
.
If it works everywhere but in Chrome, submit it as a bug.
.
http://www.google.com/support/chrome/bin/answer.py?answer=95760
.
I do something similar, but I never thought of doing it as you are doing it.

Comment by Nosredna — September 4, 2008

@rethinker. Could you specify when exactly it´s faster? Are there any recommended settings? Well it looks awesome and the discribed comperison is nice:) So you all agree to give it a try?

Comment by Billigflug — September 4, 2008

How to debug in Google Chrome (article in Spanish)

Since Google Chrome documentation about debuging is still to come and Google Chome doesn’t have a Firebug extension, I just wrote a short article explaining how to use the different tools “for developers”
available in Google Chrome.

Please take a look at the artilcle (Pictures are self explanatory, but
text is in Spanish)

“Depurar Aplicaciones y Páginas Web con Google Chrome”
http://www.tecsisa.com/index.igw?item=1608

I would be glad to add, edit or do changes as information arrives, so
feel free to give feedback.

Javier

Comment by Tecsisa — September 4, 2008

we have had so much trouble with chrome’s javascript execution model

Comment by asimplehandle — January 24, 2009

Yes,The scripting differences have been a kill for us

Comment by netcodegenerator — January 24, 2009

Leave a comment

You must be logged in to post a comment.