My Suddenly Slow-Waking MacBook Air
May 31, 2013 02:27

My main work computer is an 11" MacBook Air from early 2011. Even though the CPU was slower than the one in the MacBook Pro it replaced, it felt like a huge performance upgrade for two main reasons: 1) the SSD drive read and wrote data much much faster than the previous machine's 5400RPM hard drive, and 2) it woke from sleep almost instantly.

11-inch MacBook Air with branding

I remember Apple making a big deal about the instant wake-up when they announced these machines. It's one of those things that's easier for Apple to implement than most other computer makers, since they own the hardware, the software and the firmware.

But after I upgraded to Mountain Lion, my MacBook Air wasn't waking as quickly anymore. Opening the lid would show a frozen login screen for a while and then after ten or twenty seconds it would finally wake up and let me log in.

Ten seconds might not seem like a lot, but often when I flip open my computer it's because I'm inspired to write or code or design something. Those extra seconds can be extra frustrating - especially since it wasn't so long ago that it did wake up almost instantly.

Well, I finally figured out the problem: turns out it's a hidden configuration setting that you can adjust from the command line. The OS has a hidden variable for how long it stays in instant-wake 'sleep' mode before it writes the RAM to the SSD for 'standby' mode. Sleep mode will drain the battery in a few days, while standby mode supposedly lets the computer stay charged for as long as a month.

Engineering is all about trade-offs. Weight vs. strength. Speed vs. maneuverability. Expandability vs. stability. This setting is a trade-off between wakeup speed and battery longevity. In Lion, Apple was more in favour of wakeup speed, and set the hibernate cutoff to several hours. In Mountain Lion, Apple wanted to favour battery life and so set the hibernate cutoff to only one hour.

I'm not sure which backwoods explorers or super jet-setters regularly have to go more than a day or so between using or charging their laptop. On the other hand, there are lots of situations when a machine is asleep for more than one hour.

One hour is enough for a morning commute, especially if you stop for breakfast on the way. One hour is enough for going shopping before getting to the cafe. One hour is enough for boarding the plane, taxiing, taking-off, and getting to cruising altitude. But one hour is not enough for feeling like you've been away from your computer for a long time - and it's not enough to make you feel like you should be waiting for your super-fast MacBook Air to wake up.

I really don't want to get into some kind of stupid "this never would have happened if Steve Jobs was still alive" thing, but Steve is on record for caring about startup speed a_lot. I wouldn't be surprised if the instant start-up feature was one of the things he obsessed over at Apple back in mid 2010. Now he's gone, caution and general efficiency seems to have become more important than gee-whiz instant wake-up. (Of course, iOS devices do wake up instantly - and certainly Apple is spending more time worrying about those than their boring old computer hardware).

At least it's a simple command-line fix:

sudo pmset -a standbydelay 86400

Wish it could be a System Preferences thing, though. But, as I've learned from my years of software devleopment, every exposed configuration parameter is a support headache waiting to happen. I've also learned that there's an art to figuring out the best default settings.