Speeding up Safari: Reducing spinning pinwheels, other performance bottlenecks

Tips for boosting the performance of Apple's Web browser.

Safari is generally one of the fastest browsers for Mac OS X with regard to page rendering. Unfortunately, its also prone to significant slowdown -- including repeated stalls accompanied by the spinning pinwheel progress indicator, slow launch times, and more. There are a few procedures you can use to minimize the occurrence of stalls and eliminate other hindrances, improving the overall speed of Apple's Web browser.

Slow launching

Clean startup routines There are a number of routines Safari has to perform each time it is launched, and making sure there aren't excessive steps in these routines -- by reducing the number of files in certain locations or periodically deleting some folders altogether -- can make for fewer bounces in the Dock.

The ~/Library/Safari (the tilde [~] represents the current home user directory) folder is one of the locations you should check, because Safari checks it as well when launching. Here the browser stores bookmarks, recent downloads, form values, history and favicons, the small icons that appear next to the URL for some sites. Favicons, in particular, can cause sluggishness when starting Safari and when loading pages. Try dragging the folder Icons -- where these icons are cached -- within the ~/Library/Safari folder to the trash and restarting Safari.

Delete .plist file Another file that can be implicated in not only slow but also failed Safari launches is the application's property list (.plist) file, which is located here: ~/Library/Preferences/com.apple.Safari.plist. Try deleting it if you are experiencing slow launches, but note that you will lose some easily recoverable settings, such as whether or not tabbed browsing is enabled.

Check for errant plug-ins Problematic plug-ins can impede Safari's launch time significantly. See the section Plug-in inventory below.

Remove third-party add-ons In addition to plug-ins, other third-party add-ons can prevent Safari from launching quickly. Safari Extender, PithHelmet, SafariSIA, Safari Magic, and others are all potential culprits. Inspect each product's documentation for uninstallation instructions. After removing all third-party add-ons, you may want to restart your Mac -- as some system processes can linger after file deletion -- then check for any speed improvement in Safari.

Stalls (spinning pinwheels) or slowness when loading pages

Like slow launching, stalled or slow page loads can be due to problematic files stored within the Safari architecture. These symptoms can also be the result of accumulated memory usage and other factors.

Just quit and relaunch One of the quickest, albeit impermanent solutions for slowness in Safari (as noted by a number of readers) is to simply close then relaunch the browser. The causes for slowdown after extended operation are varied, but may include lingering, unnecessarily excessive memory usage.

Reset Safari A blanket approach to deleting many of the potentially problem-causing items is the Reset Safari... command, available under the Safari menu in Safari. Note, however, that this command also deletes your browser history, personal data -- such as stored login passwords, search entries, cookies and more -- that you may not want to clear. Still, it's a good initial cleansing step.


The Reset Safari command deletes all personal information and can also clear some files responsible for slowness

If you'd rather not invoke a full reset, try using the Empty Cache... command first. Though it's designed to speed loading of oft-visited Web pages when a slow connection is present, a full cache actually generally has a degrading effect on the speed of broadband connections.

Clear favicons Favicons, in addition to causing slow launching (as aforementioned in Slow Launching) can significant delays in loading pages. Drag the folder:

  • ~/Library/Safari/Icons

to the trash and and relaunch Safari for a potentially significant speed improvement.

If you find that routinely deleting the contents of this folder is a drag, and you don't care to display favicons at all, you can permanently disable their storage. First clear the contents of the aforementioned folder, then do one of the following:

  • Lock the ~/Library/Safari/Icons folder by navigating to ~/Library/Safari/, clicking the Icons folder, then selecting Get Info from the File menu. Check the Locked box under General.
  • Change permissions for the ~/Library/Safari/Icons folder by navigating to ~/Library/Safari/, clicking the Icons folder, then selecting Get Info from the File menu. Under Ownership & Permissions change the You can setting to Read Only.
  • Drag the ~/Library/Safari/Icons folder to the trash, then create a new blank text file in TextEdit or another application, name it "Icons" and drag it to the ~/Library/Safari/ folder, in effect blocking Safari from writing anything to that location.

Monitoring resource usage MacFixIt reader Craig Collins suggests using a utility like MenuMeters to keep tabs on Safari's usage of memory, processor time and other system resources when visiting specific sites.

Plug-in inventory Safari plug-ins can cause slowness for a variety of reasons. The easiest way to check if a plug-in is culpable in your particular case of sluggishness is to do the following:

  1. Go to the Safari menu within Safari, and select Preferences
  2. Click on the Security tab
  3. Deselect Enable plug-ins
  4. Restart Safari, and see if the slowness is gone. If so, a plug-in may be to blame. Look in the folders: /Library/Internet Plug-Ins and ~/Library/Internet Plug-Ins. Remove any extraneous items you think might be causing the slow-down, then again restart Safari and check for speed improvement.

AutoFill clutter Safari can stall when loading pages with forms (or even pages without forms) due to bottlenecks caused by the AutoFill function. If you are noticing particular slowness on pages with forms, try going to the Safari menu within Safari, and select Preferences, then click on the AutoFill tab. Turn off some or all of the options and check for persistence of the slowdown.

If you choose to leave AutoFill options turned on, you may periodically want to click the Edit button next to Other Forms in the same preference tab and delete some or all of the entries (sites for which Safari will attempt to use AutoFill).


Clearing AutoFill clutter is particularly useful for otherwise inexplicable, repeated spinning pinwheel progress indicators

Use nightly WebKit builds Though it may lead to decreased stability and other problems, you can replace the WebKit foundation (which is used by Safari and other Mac OS X applications to render Web pages) that is shipped as part of Mac OS X with the latest build available form the WebKit Open Source Project.

As stated in the WebKit documentation:

"Performance is a top priority for WebKit. We adhere to a simple directive for all work we do on WebKit: The way to make a program faster is to never let it get slower. We have a zero-tolerance policy for performance regressions. If a patch lands that regresses performance according to our benchmarks, then the person responsible must either back the patch out of the tree or drop everything immediately and fix the regression."

Check for overall network slowness If you've exhausted the above options and still don't think Safari is performing up to par, a bottleneck affecting all Mac OS X networking may be to blame. The easiest way to determine whether or not your problem lies with general network speed is a cursory check in other browsers (Firefox, etc.) on several different sites for consistent slowness.

Here are a few quick fixes you can try in this scenario:

Power cycle your network access device (Cable/DSL modem) If you are using a DSL or cable connection, try simply powering off your modem, waiting a few minutes, then powering it back on. Doing so can noticeably speed up network access.

Toggle IPv6 One of the easiest things to try for general network slowness is toggling your IPv6 setting. In order to change this setting, use these steps:

  1. Open System Preferences and click on the Network pane
  2. Select our currently used interface (Ethernet, AirPort, etc.) from the Show: menu.
  3. Click on the TCP/IP tab.
  4. At the bottom if you see a button which says Configure IPv6...' click on it and change the setting to Off. Press the Apply Now button.
Change DNS servers The DNS (Domain Name System) servers your ISP uses by default may have slow response times for various reasons. Try changing your DNS servers via the following process:
  1. Open System Preferences and click on the Network pane
  2. Select our currently used interface (Ethernet, AirPort, etc.) from the Show: menu.
  3. Click on the TCP/IP tab.
  4. Enter the desired DNS numbers in DNS Servers: field on separate lines (you can have multiple DNS servers listed). Here are some choices -- the first two are from OpenDNS, the second two are from the Open Root-Server Confederation.
  • 208.67.222.222
  • 208.67.220.220
  • 199.166.28.10
  • 199.166.31.3
  • You can also try using DNS numbers from different ISPs (4.2.2.1 4.2.2.2 belong to Qwest, for instance) or use these instructions to manually enter your own ISP's DNS numbers, which may provide a speed boost in some cases.
  • After entering the desired DNS numbers, click the Apply Now button. Again, you can use several individual DNS numbers, so experiment with varied groups and check for any increase in speed
  • Change MTU setting Another potential method for boosting network throughput involves modigying the MTU (maximum transmission unit) packet size setting.

    As the name implies, MTU refers to the largest data packet that can be carried over your network pipe. MTU is measured in bytes, so a setting of "1500" would equal roughly 1.45 KB per packet.

    For various reasons, setting the MTU at different levels can have a dramatic effect on your Internet access speed, so it's worth experimenting in order to determine what works best for your particular set-up.

    To check the current MTU setting of any currently network interfaces, enter the following command in the Terminal (located in /Applications/Utilities):

    • ifconfig -a

    You should see output of which a portion looks like:

    • en0: flags=8863 UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST mtu 1500

    en0 is the designation for a given network interface -- in the above case, a built-in AirPort card.

    If you have an Ethernet-based connection, setting the MTU is straightforward:

    1. Open the Network pane of System Preferences
    2. Choose Built-in Ethernet from the Show menu
    3. Click the Ethernet tab and choose Manually from the Configure menu.
    4. Click the button next to Custom and enter your desired MTU.
    5. After entering the MTU, click Apply Now then test your network setting

    If you have a wireless (AirPort or other) network, first log in as administrator, then open the Terminal (located in Applications/Utilities) and enter the following command:

    • sudo ifconfig en1 mtu SIZE

    where SIZE is the MTU setting you desire, e.g. 1490. You will be prompted for an administrator password after entering this command. Note that en1 is the default for most AirPort cards, but it may be eno0 or en2 depending on your specific configuration. Use the terminal command ifconfig -a as aforementioned to get a map of network ports.

    Here are some good MTU numbers to test right away:

    • 1500 (the general standard for Ethernet connections)
    • 1492 (usually the maximum for DSL-based PPPoE connections)
    • 1450
    • 1300

    Large variances in speed can occur with changes as small as 25 bytes, so keep testing your network speed after modifying the setting even slightly.

    AirPort performance If you're using an AirPort connection, check our wireless troubleshooting tutorial for tips on increasing the speed of your connection.

    Miscellaneous slowness

    Functions other than launching and page loading can be slow in Safari. For instance:

    Bookmark menu If you notice that your bookmarks menu takes an abnormally long time to appear, there are a two relatively obvious fixes. The first is to reduce your number of bookmarks or organize them into a smaller number of folders. The second, and usually more useful, is to shorten the names of your bookmarks.

    Select Show All Bookmarks from the Bookmarks menu in Safari, then click on the desired bookmark to select it, and click it once more to rename it (as you would a file in the Finder). Alternatively, hold the control key and click a bookmark (or right-click) then select Edit Name from the resulting contextual menu.

    Feedback? Late-breakers@macfixit.com.

    Like what you've found in this tutorial? Get more troubleshooting guidance (updated daily) by subscribing to MacFixIt Pro.

    Resources
  • More from Tutorials
  •  

    ARTICLE DISCUSSION

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    Hot on CNET

    The Next Big Thing

    Consoles go wide and far beyond gaming with power and realism.