Safari 3 vs Firefox 3 - Round 1: Speed Test

firefoxvssafar-round1speed.png

Safari and Firefox are the two largest browsers in the Mac market. They’ve also both recently released new beta versions. This is the first in a short series on the similarities and differences you can expect in the final versions of Firefox 3 and Safari 3.

It’s important to note, I went with the latest nightly builds of each browser (as of March 5th, 2008)–dubbed Webkit (r30790 ) and Minefield (3.0b5pre). The advantage to this is the browsers are on a level playing field–but each may have potentially buggy or incomplete features.

The Fastest Browser Wins

Safari is advertised as the fastest browser in the world, but FireFox 3 is rumored to be catching up quickly.

The best tool available for benchmarking Javascript is WebKit’s SunSpider. According to SunSpider, Safari 3 is 1.32x faster than Firefox 3.

Safari 3 vs Firefox 3 Benchmark

I performed the next test on CSS to make sure the results were representative. Unfortunately this benchmark also included some Javascript so the tests weren’t completely independent (test available here, but tuned down to not break the server).

The CSS benchmark tests the CSS background-color attribute on 60,000 divs. I ran each test 5 times. The results show Safari renders CSS 4.5x faster than Firefox.

css-benchmark.png

Still not satisfied these results were completely representative, I wanted to try another test. The SunSpider test was created by Apple, so there was a chance for a bias. I wanted to run the browsers through one more test that was independent–I decided on Quirksmode Javascript benchmark.

The Quirksmode test is a benchmark for generating large amounts of data using the following Javascript methods: DOM 1, DOM 2, Table, innerHTML 1 and innerHTML 2. I ran each test 10 times and aggregated the results. The winner? You guessed it, Safari was 1.6x faster than Firefox.

Safari and Firefox Javascript Quirksmode Benchmark

The Fastest Browser is: Safari

From these results it’s clear Safari is much quicker rendering Javascript and CSS. Benchmarking other parts of the browser (SVG, Sockets, etc…) is more difficult and outside the scope of this article. I tried to give Firefox as fair a chance as possible–but the results always came up in Safari’s favor.

safarigloves.png(This image looked so ridiculous I decided to keep it.)

Round 1 Winner: Safari

Don’t fret Firefox, there’s a few more rounds coming–and I have a feeling you’ll make up for your speed with your many other features.

Stay tuned for the next couple rounds where we outline the features in Safari 3 and Firefox 3.

Other rounds in Safari 3 vs Firefox 3 series:

Similar Posts:

I Like This Tip!


26 Responses to “Safari 3 vs Firefox 3 - Round 1: Speed Test”

  1. Haha, speed, fear of change, and a slick interface are the only things Keeping me from switching to FireFox. If Safari was actually slower, I would've been pissed considering Apple touted it as pretty much being barely slower than the speed of light

  2. Anyone else read about the controversy about Apple using their own private APIs for speeding up Safari?

  3. While researching this I found numerous benchmarks that Opera is in fact the fastest browser in the world. Considering this is Safari vs Firefox, I ignored those claims.

    Travis, Yes I read up on that. Developers are pretty upset.

    The methods exist, they're just not documented. Firefox has already put many of these new API calls into the latest nightly builds.

    As far as the ethics go? Apple probably should have disclosed them, but I personally don't think it's as big a deal as everyone is making it out to be.

  4. 4Avatars
    cris
    well.
    1. most sunspider test of most recent nightly shows firefox is 1.1xslower than webkit, not 1.3. I would also mention that in the past 30 days, webkit has no improvement, while firefox speed increase 200%. No to mention there are still more javascript optimization no out yet, including PGO, Im quite sure eventually firefox 3 will be at least no slower than safari 3.1.

    2. as a speed test, Im surprised you didn't test reading from history at all? you do realize there are a good chunk of browsing is back/forward operation?

    3. the CSS test was created 4 years ago, I think you should use more modern test if you can find one, since the CSS standard has gong through 3 version changes.

    4. methods exist, just not documented? thats exactly M$ style, Im surprised anybody would brush aside this unfair tactic.

  5. 4Avatars
    cris
    I think I should also mention that PGO is already enabled on windows version of firefox 3, and It is already faster than webkit nightly on windows.

  6. 4Avatars
    Xel

  7. 4Avatars
    cris
    hide my comments? because you guys are afraid of truth? :) lol.

  8. Cris, comments are manually moderated. I post every comment that comes to the site, good or bad--but I like to filter out spam. Don't jump to conclusions ;).

    Let's address some of the things you talk about here:

    I think I should also mention that PGO is already enabled on windows version of firefox 3, and It is already faster than webkit nightly on windows.

    This article is Mac only, so this is irrelevant. I would bet Firefox 3 is faster than Safari 3 on windows--but as we're a Mac site, we don't focus on this.

    most sunspider test of most recent nightly shows firefox is 1.1xslower than webkit, not 1.3.

    I ran the test 3 times last night and got the same results.
    Safari: http://nightly.webkit.org/
    Firefox: http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/

    I would also mention that in the past 30 days, webkit has no improvement, while firefox speed increase 200%.

    I did say this in my opening paragraph. I stated Firefox has made huge leaps recently in performance:
    Safari is advertised as the fastest browser in the world, but FireFox 3 is rumored to be catching up quickly.

    While it's nice that Firefox has gotten "faster," it's still not as fast as Safari.

    Speed has always been the #1 concern for Safari, outlined here: http://webkit.org/projects/performance/index.html

    I'm glad you're confident the final version of Firefox 3 will be as fast as Safari 3, but that's pure speculation. Let's look at the results. Right now, Safari has the upper hand.

    as a speed test, Im surprised you didn't test reading from history at all? you do realize there are a good chunk of browsing is back/forward operation?

    Caching is not my main concern with benchmarks. My main concern is the render time. Safari renders Javascript and CSS faster--it's entirely possible Firefox can render cached pages quicker, but there's no results to support that.

    the CSS test was created 4 years ago, I think you should use more modern test if you can find one, since the CSS standard has gong through 3 version changes.


    Absolutely. I could have tested more advanced CSS features, but I thought it would be fair to test one of the most basic CSS features that both browsers have supported for years. Background color is used by most Web sites so it's the best benchmark in my opinion. I could have used newer CSS3 specs, but how does that translate into real world performance?

    methods exist, just not documented? thats exactly M$ style, Im surprised anybody would brush aside this unfair tactic.


    I agree it wasn't a "nice" or "fair" thing to do. But Apple is a business and as a business must make money to make these gadgets we all love.

    The biggest marketing edge for Safari is it's the fastest browser in the world. If Apple didn't do anything to protect that claim it would loose its biggest advantage.

    Again, I agree with you. Open source should be open--and Apple has deemed Webkit to be open. They should have disclosed, they didn't. That being said, Apple has the right to protect its business in any way it can.

    If you really want to get into Apple business tactics lets talk about iTunes lock-in. Unfortunately that is not the topic of this entry, so we'll have to debate that elsewhere.

    Regardless, I appreciate your comments Cris. It lends to a better discussion on the browser wars. My goal here is to be fair. Firefox has many advantages over Safari, but right now--speed is not one of them.

  9. 4Avatars
    cris
    haha, sorry looks like I made false accusation....

    LOL

    ok, let me say something to make it right

    1. please follow the threads at macrumors.com and mozillazine.org. there are specific topics about the javascript changing in firefox 3. I would guess you guys aren't used to the idea of firefox' nightly, it actually has significant changes every day! Javascript speed just bumped another 5% two days ago.. PGO promises another 10~20%.

    2. browser speed is a complicated issue, both javascript and CSS are tiny parts of the web, all these tests have to repeat same script 100000+ times in order to measure the statitical ignificant differences, there is very little real world impact for users.

    3. on the other hand, page loading, DNS resolving, history reading, etc. have much more profound impact on users' day to day usage, and you guys pretty much tested nothing on these issues.

    4. I would advise you wait for the final test, and redo the speed test when both firefox 3 and safari 3.1 out. So many changes, your test data are already 2 days too old.

  10. 4Avatars
    cris
    well, I can't argue firefox is fater than safari on mac right away, since my own test is 5000ms vs 4500ms. But I would report data back when PGO get enable on mac verion of firefox.

    macrumors thread http://forums.macrumors.com/showthread.php?t=426038
    mozillazine thread http://forums.mozillazine.org/viewtopic.php?t=630259

  11. Cris, I absolutely agree when the final versions of Safari 3 and Firefox 3 are out we should revisit the benchmarks (and we will).

    But unfortunately we must choose a version and stick with it. I opted for the latest nightly versions of each release (because of the recent speed increases in Firefox).

    I'm glad we agree browser speed is a complicated issue :).

    And I agree Javascript and CSS are a small part of that.

    We're talking milliseconds here, which for the most part users won't recognize.

    Page render speed is loosely related with the tests above, but not completely. Render time is often what makes a page "feel" fast, so it was the focus of these benchmarks.

    Caching may have been another good test to run--which I will revisit when we test the final versions.

    DNS resolving is not a browser issue, it's a socket layer issue and fundamentally an operating system issue.

    I considered all of the different benchmarks I could possibly use, and as I stated--most are outside the scope of the article.

    The reason I added the Quirksmode benchmark is because I realized I needed something beyond pure Javascript and CSS.

    While the Quirksmode involves Javascript, it's more about processing large amounts of data.

    If you have any other methods of benchmarking Cris, I'd love to hear them.

  12. Also, I just visited those links you posted and there's a fundamental flaw in their logic of Firefox being faster.

    They're testing the newest version of Firefox with an older (but still recent) version of Safari.

    We're not comparing apples to apples in this scenario.

    In order for the tests to be relevant, you should test either:
    Latest Safari Beta vs Latest Firefox Beta
    OR
    Latest Safari Nightly Build vs Latest Firefox Nightly Build

    Mis-matching them is simply inaccurate. In this case I could test the latest Safari build with the most recent Firefox beta and claim Safari was 2x faster than Firefox.

    Those results would be inaccurate and misleading.

    I realize you're not making that claim, but the initial posts in both of those links are.


  13. Trackback
    Safari y Firefox : Canal Apple

    [...] el mundo OS X, Safari y Firefox dominan. MacTips comienza con la nueva versión beta de los dos navegadores, y testean su velocidad en varias [...]


  14. Great post! If only Safari could support all those great extensions Firefox has.

  15. 4Avatars
    cris
    fundamentally flawed?

    Did you NOT read the post by the macrumors moderater's post? he was using latest webkit nightly and firefox nightly. Maybe the OP's posts are based on safari 3.0.4. But moderator's posts are NOT. and His data shows 1.10X faster

    AND. may I suggest you download a new firefox nightly today? since there are new improvements overnight, and my test shows latest webkit (30868) is only 1.06X faster now. 4800ms vs. 4500ms

  16. 4Avatars
    cris
    here are the links for the test results:
    firefox 20080307 http://webkit.org/perf/sunspider-0.9/sunspider-results.html?{%223d-cube%22:[244,242,237,244,244],%223d-morph%22:[187,182,184,180,185],%223d-raytrace%22:[185,191,185,191,189],%22access-binary-trees%22:[72,69,72,67,72],%22access-fannkuch%22:[328,327,327,327,326],%22access-nbody%22:[255,250,276,254,252],%22access-nsieve%22:[97,98,99,98,99],%22bitops-3bit-bits-in-byte%22:[78,79,77,76,78],%22bitops-bits-in-byte%22:[119,120,121,118,121],%22bitops-bitwise-and%22:[122,125,126,122,124],%22bitops-nsieve-bits%22:[176,176,175,174,175],%22controlflow-recursive%22:[52,54,52,52,54],%22crypto-aes%22:[113,111,115,112,113],%22crypto-md5%22:[87,87,84,87,86],%22crypto-sha1%22:[86,86,93,89,91],%22date-format-tofte%22:[339,340,333,336,338],%22date-format-xparb%22:[223,225,220,225,225],%22math-cordic%22:[225,221,227,226,223],%22math-partial-sums%22:[195,210,199,197,203],%22math-spectral-norm%22:[112,112,112,111,112],%22regexp-dna%22:[397,392,393,400,393],%22string-base64%22:[127,122,126,122,122],%22string-fasta%22:[301,297,299,314,295],%22string-tagcloud%22:[225,230,225,231,231],%22string-unpack-code%22:[295,291,294,291,292],%22string-validate-input%22:[147,149,148,148,152]}

    webkit 30868
    http://webkit.org/perf/sunspider-0.9/sunspider-results.html?%7B%223d-cube%22:%5B190,182,183,183,183%5D,%223d-morph%22:%5B196,198,198,197,197%5D,%223d-raytrace%22:%5B163,170,166,165,166%5D,%22access-binary-trees%22:%5B91,94,94,93,93%5D,%22access-fannkuch%22:%5B318,321,317,317,318%5D,%22access-nbody%22:%5B194,196,197,202,195%5D,%22access-nsieve%22:%5B87,89,87,87,86%5D,%22bitops-3bit-bits-in-byte%22:%5B88,90,89,89,88%5D,%22bitops-bits-in-byte%22:%5B132,132,131,131,132%5D,%22bitops-bitwise-and%22:%5B243,249,240,240,242%5D,%22bitops-nsieve-bits%22:%5B153,152,153,153,152%5D,%22controlflow-recursive%22:%5B114,117,114,114,114%5D,%22crypto-aes%22:%5B107,110,108,108,107%5D,%22crypto-md5%22:%5B104,105,104,105,103%5D,%22crypto-sha1%22:%5B103,104,107,103,103%5D,%22date-format-tofte%22:%5B193,188,193,190,189%5D,%22date-format-xparb%22:%5B216,218,216,218,217%5D,%22math-cordic%22:%5B230,230,228,231,232%5D,%22math-partial-sums%22:%5B258,259,259,257,257%5D,%22math-spectral-norm%22:%5B114,115,116,116,115%5D,%22regexp-dna%22:%5B285,287,286,285,286%5D,%22string-base64%22:%5B136,135,133,134,135%5D,%22string-fasta%22:%5B245,249,245,247,248%5D,%22string-tagcloud%22:%5B192,191,188,190,190%5D,%22string-unpack-code%22:%5B180,181,181,182,181%5D,%22string-validate-input%22:%5B164,160,161,159,160%5D%7D

  17. Cris, Did you not read my post?

    I realize you're not making that claim, but the initial posts in both of those links are.


    They may have fixed their tests in later posts, but the initial posts are off base. The fact they were mis-matching versions shows me their bias.

    Also, testing nightly versions every day is of no interest to me. We could test every build and compare them with differing results.

    I will test the final version of each release, but for this article I picked the most recent builds (at the time) and I'm sticking with these results for now.

  18. Also Cris, May I suggest you take a look at my most recent post in the series: http://www.mactips.org/archives/2008/03/07/safari-3-vs-firefox-3-round-2-security-and-standards/

    I think I've done a fair job thus far comparing the two browsers.

    Let's agree that I'll test the final release of each version (with more and better benchmarks) and let's move on.

  19. 4Avatars
    cris
    Sure, I would be glad to read your updated test after the final release.


  20. Trackback
    // wyctim.blog » Blog Archive » Heti Linkek

    [...] Safari 3 vs Firefox 3 - Round 1: Speed Test - MacTips Firefox és Safari sebességtesztek. [...]


  21. 4Avatars
    Isaac
    Which OS / machine did you run these tests on? The Windows version of Firefox 3 has PGO (or whatever it's called) enabled which gives (apparently) a significant speed boost. I've just compared the latest Safari and Firefox builds on SunSpider - FF3pre5 came out 2.5x faster (this is on Vista).

  22. 4Avatars
    cris
    Just a head up

    Today's nightly, firefox 20080317 is already 1.02x faster than webkit today's nightly 31090.

    Firefox is changing compiling environment of its mac version from Tiger (xcode 2) to leopard (xcode 3). My estimation from test build is that It will speed up firefox 3% on Tiger, and 8% on leopard.

    As of now, Firefox 3 nightly is fastest on any platform in javascript performance.

    PS. Safari 3 is quite different from safari 3.1, we all know safari 3.0.4 are 3x slower than 3.1 and firefox 3 nightly.

  23. Cris, I thought we were going to drop this ;)

    I will have new results when a new version of Firefox is released.

  24. Firefox 3 Final is out, maybe you want to redo the test?

  25. Emilio,

    I actually conducted some real-world tests (not necessarily the ones shown here) between the Firefox release and the latest Safari, and I'd have to say I was pleasantly surprised at how fast the new Firefox really is. You can read about it here:
    http://blog.ashuc.com/2008/06/17/firefox-30-as-good-as-safari-311/

  26. 4Avatars
    Jonas Grimfelt
    Did you have any plugins loaded in Firefox? Safarai sux when it comes to customazation... I roll with FF for now...

Post a comment to "Safari 3 vs Firefox 3 - Round 1: Speed Test"



MacTips Newsletter


Twitter MacTips

  • Stay up to date with the latest Mac tips, tricks and news by following us on twitter: MacintoshTips.

AppleGazette Headlines

Most Popular Tips (30 Days)

Most Commented (30 Days)

Good Tips

Recent Discussions

MacTips Poll

What level of tips would you like to see?

View Results

Loading ... Loading ...

Friends of MacTips

Subscribe to MacTips

Site Links