I've set out to see if Safari 8 is as fast as Apple claims. They loved to advertise that Safari is 6 times faster than other browsers when it comes to "typical website javascript" which, as empty a statement as that is, is a pretty bold claim. I was skeptical because a 6x improvement in javascript performance would be truly astounding; javascript is already pretty damn fast. So I asked: is Safari really that fast?

To benchmark the three browsers, I decided to run a range of tests: Sunspider, Kraken, Octane, Peacekeeper and Minesweeper. To help normalize everything a bit, I ran each test in each browser 3 times and averaged the results. Between tests, I cleared the browser's cache and cookies, and restarted the browser to ensure each run was "fresh". I ran the tests on my 2012 MacBook Air with a 1.8Ghz core i5, 8GB of RAM, running OSX Yosemite. My method is not the most scientific, but it's enough to get a sense of what "normal" people may experience.

The short of it is, no, not really. To be fair, I don't think Apple lied. If anything they probably benchmarked Safari against old versions of Firefox and Chrome, or created their own benchmark and found specific edge cases where Safari performs better. But without more information on how they went about testing it, I'm merely speculating. I ran my own tests, and as I expected Safari is about as fast as Firefox and Chrome.

Look at these pretty charts:

Bar chart comparing the results of the Sunspider benchmark run with Chrome 38, Firefox 33 and Safari 8, shorter is better. Results: Chrome - 361ms, Firefox - 201ms, Safari - 238ms Bar chart comparing the results of the Kraken benchmark run with Chrome 38, Firefox 33 and Safari 8, shorter is better. Results: Chrome - 2.136s, Firefox - 1.348s, Safari - 2.512s Bar chart comparing the results of the Minesweeper benchmark run with Chrome 38, Firefox 33 and Safari 8, shorter is better. Results: Chrome - 10.2s, Firefox - 8.9s, Safari - 8.5s Bar chart comparing the results of the Octane benchmark run with Chrome 38, Firefox 33 and Safari 8, higher is better. Results: Chrome - 20222.7, Firefox - 17976.3, Safari - 15817 Bar chart comparing the results of the Peacekeeper benchmark run with Chrome 38, Firefox 33 and Safari 8, higher is better. Results: Chrome - 3393.3, Firefox - 3491.3, Safari - 3818

Unsurprisingly, Firefox performed best in Kraken and Chrome performed best in Octane, they're made by Mozilla and Google respectively. Sunspider isn't the most relevant benchmark these days, but when it comes to testing the core of the language, it's something. Chrome was surprisingly slow here, but I imagine Google is more worried about optimizing for more complex algorithms than the small pieces. The Minesweeper benchmark was run using the "Island" pattern on a "huge" size board, and Safari being the fastest is at least showing that Safari is pretty quick, even if it gets crushed in the other benchmarks.

The most revealing benchmark, though, I think is Peacekeeper. It's arguably the most neutral, as its creators (to my knowledge) have no stake in any browser in particular. It also tests things beyond javascript features. Many of its tests benefit from things like hardware acceleration, and Safari was the clearcut winner in this benchmark. Just watching the test run, there was a noticeable difference in performance in Safari. It wasn't a 6x improvement by any stretch of the imagination, but it holds a solid lead.

At the end of the day, modern browsers are just really good at javascript. They're all pretty damn fast. The differences in speed users will notice will come in the form of smoothness. Whether that's in scrolling, animations or how quickly pages are painted to the screen, it won't really matter. For the most part, javascript doesn't determine how fast a browser feels when you compare the newest of each of them. You can always find edge cases, but they're about as fast as each other these days.

I will say, however, that Safari does feel faster than Chrome from time to time. A simple test of scrolling quickly through my news feed on Facebook reveals a fair amount. In Chrome, the page stutters a bit as I go. In Safari, it's far less so. These are the kinds of differences users notice in the end, and I'm not sure this is something benchmarks will accurately capture. So while I don't think Safari is actually 6x faster than the others, I will say that Apple isn't wrong: it's a speedy browser.

Still, some more information on how they arrived at that chart they loved showing off would be nice. If anyone knows, I'm definitely interested.