I recently solved some maddening performance problems on my original aluminum MacBook running Mac OS X 10.7 Lion, and I wanted to share my findings to help others avoid similar troubles. Most interesting about the problems was the technique I happened on for isolating the culprits, which revolved not around raw performance, but battery life.
I needed to spend the entire plane flight out to Macworld editing a book, but I knew my MacBook’s battery, even though I had just replaced it, would have trouble lasting the long flight from Detroit to San Francisco. So I turned my screen brightness down to the lowest level, shut off Wi-Fi and Bluetooth, and set my Energy Saver settings to their most parsimonious.
But here’s the thing about battery life on modern laptop Macs — it’s driven as much by CPU activity as anything else. That is, your MacBook may feel reasonably snappy, but if one of the Intel Core 2 Duo’s cores is being monopolized by an errant application, your battery life will suffer tremendously.
Knowing this, and since I had Wi-Fi off on the plane anyway, I quit Google Chrome, so the only applications that I was using were Pages, where I was editing, BBEdit, which is what the book is about, and Keyboard Maestro, which I was using to make Pages more keyboard-oriented. I figured this would be a rather minimal load and might give me as much as 4 hours of battery life.
So I was rather distressed when I glanced up at the battery life estimate indicator after 15 or 20 minutes of editing and saw that it was predicting only about 2 hours. What could possibly be eating my precious battery power?
A quick trip to Activity Monitor revealed that a process I’d never seen before, called Mingler, was using nearly an entire core — it was hovering at about 97 percent CPU usage. (Activity Monitor’s percentages are by core, so if you have a 12-core Mac Pro, 12 different processes could each be listed as using 100 percent.) I quit Mingler from within Activity Monitor, made a mental note to figure out what it was, and went on with my work. My battery life estimates improved, but the damage was done, and I was able to work for less than 3 hours.
Roughly the same thing happened on the flight back, but once at home, performance actually got worse, and another culprit reared its ugly head in Activity Monitor. This one was a smoking gun, since its name was SafariDAVClient. Some quick research on the Internet revealed that SafariDAVClient and Mingler are both related to iCloud bookmark syncing. (Although I don’t use Safari as my main browser, I do use it for certain tasks, and iCloud bookmark syncing is a good way to manage the Safari bookmarks on my iPhone.)
Since iCloud stores the master copy of bookmarks in the cloud, I simply turned off bookmark syncing in the iCloud pane of System Preferences, renamed the Bookmarks.plist file in
~/Library/Safari to oldBookmarks.plist (see " ," 20 July 2011), and turned bookmark syncing back on. A new copy of my bookmarks was retrieved from iCloud, and I haven’t seen SafariDAVClient and Mingler since. (I assume they’re still doing their job, but with nothing much to do, they presumably launch and quit silently in the background.)
The problem, therefore, was a somewhat corrupted Bookmarks.plist file in Safari that was causing iCloud bookmark syncing to choke in such a way as to use a vast amount of processing power, and, in the process, battery power.
I realize this is all very specific, and if you’re experiencing notable performance problems in Lion, it’s certainly worth seeing if either Firefox or iCloud bookmark syncing is the culprit. But realistically, it’s unlikely that either would be your particular problem. You can, however, use roughly the same technique I did, in terms of keeping Activity Monitor running, with the list sorted by the %CPU column, and seeing if anything unusual seems to be bubbling up at the top of the list.
And of course, if you’re interested in a complete discussion of performance issues on the Mac, Joe Kissell’s “” is the definitive source. We have a minor update to that title to add Lion-specific information coming very soon; it will be free to all owners of the book.