Does Safari make Macs sluggish?

“Macenstein.com has an interesting article about a slowdown in other applications when a Safari window with a specific set of pages is loaded in the background. What a browser should do when it is the background application is actually extremely complex, and not all of the decisions are as clear-cut as they might seem,” Dave Hyatt blogs for Surfin’ Safari.

Hyatt explains, “Before I drill into the specifics of what a browser does with background Web pages, I’d like to first state that it’s dangerous to jump to any general conclusions when the sample set of pages is very small. In the example article cited above, the author visited five Web sites and clicked around within them. It’s possible that this pathological behavior is specific not just to one Web site but possibly even to one specific page on that Web site. In order to identify the problem it would be better to try the test again with each individual page.”

Hyatt writes, “One might expect that a background browser window would do nothing. However, that is a fairly naive assumption once you take a look at the kind of Web content that exists today. There are many ways in which a browser can still be doing required work even while in the background. Here are some examples:”

• Animated GIFs
• Plugins
• JS Timeouts and Interval
• Marquees
• XMLHTTPRequests
• The Back/Forward Cache

Hyatt writes:
A few other final points to make are:
(1) Browsers rarely get served the same content, even on very popular sites. Without spoofing it’s hard to know if Safari is being served some buggy content from one of the pages in question.
(2) A small sample set isn’t enough to draw general conclusions. Try a bunch of other different Web sites and see if a slowdown still occurs. If so, then maybe there is a systemic problem. Until then, though, all we know is that something is hogging CPU in one of five Web pages.
(3) Reduce reduce reduce! Reduce the problem if possible. Cut it down to one page. Don’t go back/forward (just go right to the pages instead of clicking through to them).

Provide us with precise steps to reproduce and we can verify what the problem is and fix it very quickly. In fact, it may have already been fixed!

Full article here.

[Thanks to MacDailyNews Reader “davecc” for the heads up.]

MacDailyNews Take: Dave Hyatt is employed by Apple Inc. as part of the development team responsible for the Safari web browser and WebKit framework. He was part of the original team that shipped the beta releases and 1.0 release of Safari. Hyatt is currently the Safari and WebKit Architect.

76 Comments

  1. A slow website (I have very fast cable broadband) server can drag down the rest of Safari and sometimes other apps. I have multiple bookmarks grouped in tabs and surf by groups, loading multiple sites at a time. If a site is slow to lead, like Think Secret’s 10.5 gallery yesterday, it can slow the loading of other tabs with good server response. I do not see the same thing in FireFox, so it should be fixable.

  2. Safari definitely slows my G4 Dual 1GHz down once in a while and Safari sometimes practically stops. To get out of the situation I just restart the app and continue browsing smoothly again. With the newer machines it’s not that noticeable.

  3. You quit “every few DAYS”???

    Here’s a nutty idea: Why don’t you just quit Safari when you’re not using it? I don’t leave any application on when I’m finished with it. Quit the thing, let the OS clean up. A clean system is a happy system. That’s true for any OS.

    And yeah, Safari can be a drag. On our G4 iBook, if I need to switch into my account, I always ask my wife if I can quit her Safari session first. If I don’t do that, the iBook is sluggish as hell with two user sessions and two Safaris going.

  4. I think the problem lies in WebKit. Firefox has always run faster than Safari on my Macs, but version 2.0 (2.0.0.2) runs much slower than 1.5 did. I’m hoping one of these two browsers runs better under Leopard.

    Also, I hate the way Safari deals with bookmarks. Why do they have to be displayed as a webpage in the main browser window? Why can’t there be a drop-down menu of bookmarks like every other browser in this world?

  5. I have had numerous slowdowns when using Safari with a few tabs, and it takes forever to switch from one tab to another. I’ve tested 5 other browsers (Opera, Shiira, Omniweb, Firefox, Camino) and Camino is by far the best of the bunch (Firefox has bugs and looks awful, Opera looks awful, Omniweb is too big), and Camino is a million times more responsive than Safari when working with tabbed browsing. (Shiira is also very fast, but has a few annoying bugs, so Camino gets my vote).

  6. My experience is similar to “tclash”, Safari get snapper after a restart. Why can’t Safari run more like Firefox?

    What I wonder is why does the Apple calendar take so long to open? I wish some one at Apple would look at making the calendar more crisp?

  7. LordRobin: “Here’s a nutty idea: Why don’t you just quit Safari when you’re not using it? I don’t leave any application on when I’m finished with it. Quit the thing, let the OS clean up. A clean system is a happy system. That’s true for any OS.”

    People like leaving their frequently used apps open because we don’t have to wait for the launch time to finish. Sometimes, you want to leave a window open without having to bookmark it, quit, re-launch later and delete the bookmark. Frankly, a well designed app can be left running in the background without consuming much resources. The need to quit an app and re-launch it just to clear up memory leaks tells you that there are problems with the app.

    That said, browser apps have become bloatwares. All of them. I use Firefox because the way it handles Pages Not Found due to edits in /etc/hosts better, but Firefox has a very bad memory leak.

  8. Of course Safari makes your Mac sluggish.

    The reason for this is that all the associated caches go into memory (some of them needlessly) and your mac ends up using your hard drive as a memory device (now you’re really sluggish).

    Here’s a time-tested method: clear out the following files or directories completely once in while
    (every couple days if you wish):

    # Locations of Safari related files
    /Users/YOU/Library/Caches/Safari/
    /Users/YOU/Library/Caches/Metadata/Safari/
    /Users/YOU/Library/Safari/Icons/
    /Users/YOU/Library/Safari/History.plist

    # Locations of other garbage files
    /Users/YOU/Library/Caches/Java Applets/cache/
    /Users/YOU/Library/Caches/Quicktime/
    /Users/YOU/Library/Caches/Sherlock/
    /Users/YOU/Library/Caches/TextEdit/
    /Users/YOU/Library/Icons/
    /Users/YOU/.Trash/

    # Location of any broken printer files with dash-numbers, eg. HP-1, HP-2; (can be a real CPU hog)
    /Users/YOU/Library/Printers/

    Notice there are other garbage files above that slow you down. Have fun now.

  9. I have to turn Safari off every now and again on my 1.5GHz G4 Powerbook. It has got worse over time – sometimes i have to go away and make a coffee while the beachball spins and the hard drive goes mad. Its not only a question of background windows – it also happens with only 1 or 2 windows on occasion…

    I have deleted all the gargage files (thank you checksum) and will see if this helps…

    Also Safari crashes more frequently than I would like…

  10. One of the things that bugs me about Safari is that there is no “Home” button. Secondly, bookmarks are all put into a page rather than an easy access menu, and removing them means you also have to go back to this page. Why are bookmarks not intuitive like every other browser?

    I have to use IE at work, and all my PC’s have Firefox. Safari works except for these issues whch are enough for me to move to Firefox, or perhaps I’ll try Opera. It works well on the Wii!!!

  11. Glad Safari’s sluggishness wasn’t just my imagination; especially noticeable on an older machine. Web based bloatware has evidently has succeeded in making Safari require as much data throughput as a TV.

  12. I tend to load multiple windows with multiple tabs in Safari, and I can always tell when Safari jumps up its foreground and background usage.

    (1) Sites with banner ads, which I don’t block, because that command also blocks sites with very nice headers;
    (2) sites with lots of javascript, guaranteed to rev Safari’s engine
    (3) PDFs (I preferred it when Safari just downloaded them) now that they get read in line, they often choke Safari after closing the window; and
    (4) Having more than 10 tabs open in a window.

    I can’t say why, but my daily blog list includes 31 sites. If I select open all in tabs, which I normally do, Safari either needs to be shutdown or the computer restarted to get it back to its fast and furious state. But if I just select my top ten from the list and open those, I can keep going, so long as I don’t hit more than 10 simultaneous tags.

    But some sites code just suck, and then they add ads into the mix. One site I visit daily, Safari practically has to chew threw to get it to display, and then they f*cking reload to display ads. Great content, idiot developers.

  13. I’ve had Safari open for many days now, and Activity Monitor tells me it’s using 491MB of real memory and 1.25GB of virtual. This with only the MDN page open, that’s all. I quit it and brought it up again and this time real memory is 50MB and virtual is 400MB.

    I’ve also noticed long page load times with Safari. I’ll see in the status bar that it’s loaded like 62 of 66 items, and there it sits for many seconds. Why can’t it show me what it’s got so far? I could be reading SOMEthing while it loads up those few remaining ads.

    I was going to also complain about those annoying textual pop-ups, or whatever they’re called. You know, you just so happen to have your mouse on top of one of them and it pops up some stupid ad that blocks what you’re reading. (Really makes me wanna go buy something from them, ya know?) Anyway, my complaint was that quite often when one pops up and I move my mouse away to make it leave, it doesn’t. I have to mouse over another one and let that one pop up then move away from that one. Is that Safari’s fault, or MDN’s? Or the advertiser? And now that I’ve restarted Safari I can’t find any of those annoying thingies, not here on MDN or in any other web site I frequent. That is certainly not a complaint, but it does puzzle me why they disappeared.

    RambleMode = Off

  14. Switcher: “One of the things that bugs me about Safari is that there is no “Home” button.”

    Um. I’m looking at my Home button in Safari right now.

    Right click on a button you do have, choose Customize Toolbar and then drag the Home button to the buttons row.

Reader Feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.