Google Chrome 2.0
Friday, May 22nd, 2009Chrome 2.0 shipped out of beta today.
The New York Times seems to like it.
Chrome 2.0 shipped out of beta today.
The New York Times seems to like it.
I’ll be presenting as part of a discussion called What Makes Browsers Performant at the Velocity 2009 Conference, on June 23rd. I’ve got limited time, but I’ll give an overview of how we approach performance in Google Chrome, detail some of the key areas in performance which make Chrome stand out, share some performance numbers never before shared, and hopefully squeeze in a must-see demo or two.
I’m a developer, not a marketer, so this will be an entertaining, technical talk, with no spin and no “marketecture”! As a bonus, I promise to tell at least 2 good jokes. If you don’t laugh, you get your money back. Ok – that’s not true, ask the conference people about that.
If you haven’t signed up yet for Velocity you can use the coupon code VEL09FSP to get a 15% discount on tickets.
Several articles have been written about the latest in Javascript performance. Here are some interesting points:
DownloadSquad:
“Chrome 2 beats Safari 4 like a rented mule”
Also interesting is that Firefox’s Tracemonkey Javascript engine may be falling behind. Numerous articles have opined that Firefox 3’s ship date is in jeopardy due to Tracemonkey related bugs. But new data also confirms that Javascript in Firefox 3.1 beta 3 is markedly slower than Firefox 3.1 beta 2. The performance loss is palpable – Firefox lost 20% in performance from beta 2 to beta 3. The problem may be that as the bugs have piled up in Tracemonkey, the fixes to ensure stability have eroded the performance gains initially boasted by the team. It will be interesting to see Firefox’s final performance numbers when it ships out of beta.
One of the features in Chrome is that it is a multi-process browser. To most people, that doesn’t mean much. I could tell you that using multiple processes improves security, performance, and memory management, but you’ll probably yawn. Here is my attempt to look at one angle of multi-process performance with a demo.
Process Priorities
Operating Systems like Microsoft Windows generally support the notion of running different processes at different priorities. Because Chrome isolates each “tab” into its own process, Chrome can tell the operating system which tabs are important and which are less important. When you switch to a tab, Chrome automatically tells the operating system to lower the priority of the tab which moved to the background, and raise the priority of the one which moved to the foreground. Other browsers can’t do this because those browsers run all tabs run in a single process.
Why does this matter? There are two primary reasons.
First, when you have many tabs open, the tab you are actively working with will get the most CPU resources. A background tab can continue to run, but it will never slow down your foreground work – because the operating system ensures that the higher priority processes always run first, even if it means starving the background process. This keeps your browser responsive and snappy no matter how many tabs you’ve opened.
Second, by lowering the priority of unused tabs, Chrome is being nicer to other applications. Whether your other application is Outlook, Word, Firefox, or even a game, Chrome’s background tabs cannot slow down those other applications because Chrome has intentionally yielded its priority to other applications. Chrome is the only browser which does this. Ironically, by making Chrome’s background tabs run slower, it makes your system faster!
Quick Demo
Let’s run Chrome 1.0. In one tab, I’m running the v8 benchmark. In another tab, I’m running my CPU spinner page which eats up lots of CPU. If these two pages run concurrently, the browser’s score on the benchmark will be lower because the browser is doing two things at once. However, if Chrome properly lowers the priority of the background task, then the benchmark score should be unaffected. I’m running these tests on my laptop- a single processor machine.
First, here is the V8 Benchmark for Chrome. Chrome scored a 1333 in this quick run when nothing else was running.
Next, we run the CPU spinner in a background tab, and run the benchmark in the foreground. Chrome’s performance is unaffected by the background work, and in this run scores 1345.
Let’s try the same thing with Firefox 3.
First, a dry run for the benchmark. Firefox scores 165 on this test.
Now, with Chrome running the CPU spinner in the background, Firefox is not impacted. Firefox still gets a score of 157, even though Chrome is using 100% of the CPU in a background process! Priorities actually work.
Finally, lets see what happens if Chrome didn’t do this. This time, we’ll let Firefox run the background tab and see if it effects Chrome’s benchmark score. Sure enough, Chrome’s score drops to 762 (it was 1333). Firefox degraded Chrome’s performance by nearly 50%.
Other Performance Benefits
Startup performance is also enhanced with this feature – especially when you startup with multiple tabs. In this case, Chrome will lower the priority of the background tabs, and only the foreground tab will have high priority. You get the foreground tab first (which is what you want), an the secondary tabs fill in as CPU becomes available.
Conclusion
When single process applications like Firefox, Internet Explorer or Safari run web pages in background tabs, they can reduce your foreground application performance by as much as 50%! However, because Chrome uses background process priorities, it has almost zero impact on foreground applications. This lets the user get his work done and not worry that idle applications are in the way.
All part of what you get with a multi-process browser.
I get a lot of questions about the latest releases of Chrome which are available and how to get it. Chrome releases a little differently from other software.
If you just download the default version of Chrome, you’ll get the “stable” version, and you’ll automatically be kept up to date with the latest “stable” releases. New releases will come out only when the software is ready – it may be several months between versions.
If you want to see features more quickly, you can switch the to “beta” version. Again, you’ll be automatically kept up to date with the latest beta versions. These versions are generally stable (we constantly run a plethora of tests to keep code in reasonably good shape), but this is less tested than a stable release. New releases may come out every month or so.
Finally, if you really want to see new features as they come in, you can subscribe to the “dev” channel. Again, you’ll be automatically updated as new developer releases are available. New releases may come out every few weeks. These builds are tested well, but users should be aware that these releases will be the least stable.
To select which version of Chrome you want, you’ll need to run the Chrome “channel changer”. You can get a copy of it here, or you can read more about it from here. Once you’ve picked your channel, restart your browser, and soon you’ll have the version to which you’ve subscribed.
Here is a screenshot of the channel changer:
Google Chrome shipped today! If you didn’t try Chrome because it was in beta, you can now download a finished and supported product.
Some people associate Google with never-ending betas. GMail, for instance, is still in beta. Remaining in beta was never the intention for Chrome; we always had a simple goal to take Chrome out of beta as soon as it we had data to prove that it contains enough features, stability, and performance that real users would be happy with it as a primary browser. We hope we’re at that point.
Our goal is to move quickly with new features and fixes for Chrome. More needs to be done and more is coming. If you’ve got comments or suggestions, be sure to let us know.
PS: I do not speak officially for my employer.
Here’s a self promoting link to a blog post I wrote for the official Chromium Blog about Chrome Memory usage.