Stop. Don't look up. Don't look outside of the box, the rectangle holding this text. Can you tell me which browser you're using? Did you choose it yourself for all the right reasons? Can you explain why you're trusting your precious HTML-encoded content to this browser, the way a major league batter can explain why maple or ash and a thin or thick barrel is absolutely the right choice for sending that ball into the bleachers? Are you sure this browser is the best choice for the tags and the metadata hurling toward your computer?
If you can't answer the questions, get out of here. If you think that this highly optimized, just-in-time, infinitely customizable technology is another mere commodity, don't even bother finishing this sentence to look for the insult you know is coming. You're not good enough to read this text. You don't deserve the information.
Now that the room is cleared of the drones who go through life happy to use whichever browser their fellow drones in the IT support staff installed in their computer, it's time to look once again at the browsers and think about what makes them better. What? You did that several months ago? You're thinking, "How much could they really have changed?" Do I need to go back to channeling David Mamet?
The browser world is taking Ezra Pound's command to make it new to extreme lengths, and much has changed since I started writing this sentence. Why, just a few moments ago, Firefox and Chrome both dropped their late morning builds, and the programmers at Microsoft are heading off to teatime, so they've pushed their latest versions. New versions are appearing every several weeks, and they often include substantial new features, such as better fonts, new video codecs, more sophisticated privacy switches, better local storage, and more. It's not a question of whether you're using your grandfather's browser or even your father's browser. Now you can come back from lunch and lock up your brain wondering whether you can make it through the afternoon with the browser you installed this morning.
Before the picture changes again, here's a survey of the five major browsers -- Opera, Safari, Chrome, Firefox, and IE -- and how they are performing right now. All of them are excellent tools written by driven programmers who see themselves locked in a battle for the future of humanity, which it is if you forget all of the physical objects that occupy those other moments when we're not checking our email or browsing a new site.
The list of changes and improvements is so long that this article can't begin to mention everything. I've tried to hit a few of the most important points.
Battle of the Web browsers: HTML5
Does this matter to the average user? Not yet. Most websites don't use any of the new features today, but this is gradually changing as Web developers start to take note. Google is pushing Web apps through the Chrome Web store and clearly sees HTML5 apps as a big part of the software ecology.
A good place to begin comparing the browsers is to look at a checklist test like The HTML5 Test, a slick piece of JavaScript that grades your browser as it loads the page. The HTML5 Test gives out points for the availability of a long list of features, then totals up the score.
The HTML5 Test
Raw score | Extra points | |
---|---|---|
Chrome 10.0 | 290 | 13 |
Opera 11.10 | 258 | 7 |
Firefox 4.0 | 255 | 9 |
Safari 5.0 | 228 | 7 |
Internet Explorer 9.0 | 130 | 5 |
Although these scores vary widely, it's a big mistake to assume they mean Chrome is twice as good as IE at HTML5. The website checks for support of a feature by looking for objects in JavaScript. If the objects are there, the browser earns a point.
IE9, for instance, implements what I think are the most important parts: the local storage, as well as the canvas, video, and audio tags. It falls behind because it gets only 4 of the possible 90 points for the way it doesn't implement the new features for testing input to a form. Granted, these 86 points that IE didn't earn correspond to real features, but I don't think they're the most important features. Furthermore, while smarter forms sound like a good idea, their allocation of 90 points distorts their importance. Features like Web Workers get only 10 points, but they may be even more useful for writing client-based code.
There are more sophisticated trials like Philip Taylor's extensive collection of tests that push every part of the canvas specification. Because it creates a canvas object for you, Chrome gets a perfect score of 20 in that field from the HTML5 Test, but it passes only 636 of Taylor's tests and fails 141 of them. IE9 does better here, failing only 67, half as many as Chrome.
Is this gap important? Many of these missing capabilities may not be essential for creating great games. Many of Chrome's failures seem to involve parsing some of the numerical parameters. I'm not sure whether to chuckle about or salute the news that the browsers are supposed to be able to parse octal. In another test with a 2D transformation, Chrome left a pixel with an alpha blending value of 254 instead of 255. IE, on the other hand, also seemed to fail a random test here or there.
What's the overall message? The big new features like the canvas or the local storage are finding widespread adoption. Even the failures by Chrome aren't that serious. While certain individual features may not pass every test perfectly, the core is ready for JavaScript programmers to churn out more games and slick presentations that write directly to the canvas.
For all of the attention lavished on the canvas object, other features are getting little attention from the browser programmers. Microdata formats that provide a standard structure for dates and other common data aren't getting implemented. Local devices like video cameras and joysticks are also largely ignored -- not that this matters because they've just changed the standard to be more flexible.
My advice is to not think about this too much unless you plan on using an application that works with features like forms that are implemented by only some of the browsers. The days when there were many practical differences between the browsers are now behind us. IE has caught up nicely, and I expect Microsoft will continue to push compatibility because the company understands it doesn't have the domination it once enjoyed.
Battle of the Web browsers: Speed
Below, you'll find a table I built up running the latest browsers on a quad-core Windows Vista PC with 3GB of RAM. Your mileage will vary, and performance will improve as the browsers get better at exploiting video cards and multiple cores.
JavaScript benchmarks
SunSpider 0.9.1 (smaller is better) | V8 version 6 (bigger is better) | |
---|---|---|
Chrome 10.0 | 581ms | 4,486 |
Firefox 4.0 | 534ms | 2,100 |
Internet Explorer 9.0 | 437ms | 1,321 |
Opera 11.10 | 558ms | 2,040 |
Safari 5.0 | 658ms | 1,517 |
It's important to regard these benchmarks with a certain amount of skepticism. Both the SunSpider and V8 benchmarks include computationally heavy tasks like encryption routines. These bit-banging operations can be a good test of raw performance, but they're not very common in real-world applications. Even when applications use encryption, they rarely do it thousands of times in a row. Your experience may be quite different unless you're constantly and repeatedly encrypting items.
The benchmark developers try to address this problem. Google's V8 designers, for instance, searched the Web for a number of common regular expressions like the ones used to trim white space off the end of strings, but again it's not clear how common these operations are in the wild. I'm sure the most important number for the user is how quickly getElementById is executed.
It's becoming more complicated to evaluate performance because raw JavaScript performance is no longer the only proxy for speed now that the browsers are off-loading some processing to the video cards. Microsoft circulates a benchmark test that calculates the frame rate at which bubbles can be drawn with vector graphics. Thanks to GPU hooks, IE9 runs dramatically faster than the other browsers with a frame rate that seems to be at least twice Chrome's on my machine. If you're playing games and enjoying slick presentations on your computer, you may want to trust this benchmark more than the computationally intense versions.
This game promises to get even more interesting because Microsoft recently brought up benchmarking the power consumed to load a page. This is sort of related to the speed, but it's increasingly important for laptops and tablets. We may turn to this soon.
Battle of the Web browsers: Video and audio
I'm not sure how much this matters to the average person. The Theora website, for instance, includes a list of sample videos, and I was able to play some of them with Safari or IE. Why? The video's host, Blip.tv, gracefully switched to a different format, and I sailed on unaware.
This may not be much of a problem for the average website developer either because many don't bother trying to stream video. If Microsoft is happy to plop videos on YouTube instead of hosting the bits themselves, then there may not be any reason for the rest of us to host the video either. Let's just upload it to a free video streaming site that covers the bandwidth costs. How long will Google continue to pay for everyone's video bandwidth? I can't be sure, but it also means that most people don't spend much time worrying about these standards. If these free hosts disappear, the landscape will change quickly.
Video and audio formats supported
H.264/MPEG-4 | Ogg Theora/ Ogg Vorbis | VP8/WebM | |
---|---|---|---|
Chrome 10.0 | No | Yes | Yes |
Firefox 4.0 | No | Yes | Yes |
Internet Explorer 9.0 | Yes | No | No |
Safari 5.0 | Yes | No | No |
Opera 11.10 | No | Yes | Yes |
Battle of the Web browsers: Plug-ins and extensions
Firefox continues to have the most extreme API that allows a number of different types of extensions and plug-ins, and many of these come with their own sub-extensions. Firebug, for instance, has its own ecosystem complete with both browser and server-side plug-ins for debugging Web applications. Greasemonkey makes it simpler for people to write a bit of JavaScript to create a plug-in, and these Greasemonkey scripts trade online. Both remain reasons why I instinctively turn to Firefox.
The other browsers don't offer the same sophistication as Firefox, but they come through with what most people will want: a way to bundle together some JavaScript, CSS, and HTML to do the job. This formula handles most of what anyone would want to do, and it's why the majority of the major extensions are available for all of the high-profile browsers. Once you write the JavaScript, porting between browsers is relatively simple.
This has made it simpler for Chrome and Safari to catch up quickly with Firefox. Safari has a similar API to Chrome, which has helped clear the way for extension creators to port their work from Chrome to the Apple browser. Opera now is pushing a similar JavaScript-based plug-in framework, and I expect it will be an attractive target for extension developers too.
IE continues to be a challenge for JavaScript developers and an opportunity for those who know C++ and ActiveX. This may not matter much in the future because Microsoft is pushing pure HTML5 development more and more. IE9 has new ways to "pin" websites (that is, attach them to the Windows Taskbar or Start menu or wherever), and I expect these may begin to take the place of extensions in the future. In a way, they're almost like plug-ins.