Monday, July 6, 2009

I'll just reboot, thanks

Ever since the invention of APM (Advanced Power Management) in 1992, then ACPI (Advanced Configuration and Power Interface) in 1996, modern computers have had the ability to enter a low power mode typically referred to as "Sleep Mode", "Stand By", or "Suspend". Usually, this is done by cutting all power to the system, except that required to keep memory "alive".

You see this a lot with laptops, as it is a great way to save battery when you aren't going to use the laptop for a while. I used to do this all the time when I ran Linux on my laptop at work - worked great. If I needed to take my laptop with me to a meeting, I wouldn't shut down. I'd just put the laptop to sleep, bring it with me to the meeting - and if I needed the laptop, it took only a few seconds to resume.

But I probably used this feature the most when traveling. At a conference, I'd regularly check email during "down time". When it was time to attend a session, I'd put the computer to sleep, then during the next break I'd wake up the system and see if anyone had replied to my messages. It doesn't take long for Linux to do a hard boot, but it certainly took much less time to suspend the laptop, and resume later when I needed to use it.

Now that I'm forced to run Windows at work, I've tried to use the "Sleep" feature in the same way. I'll tell you, I'm not sure why Microsoft even bothers with this option. Under Windows Vista, there's a button that claims "Saves your session and puts the computer into a low-power state so you can quickly resume working." Technically, this is Hibernate, where the contents of RAM is written to non-volatile storage, such as the hard disk. Later, when you bring the system back up, the memory is read back from disk and things should be back where you left them.

However, I've never seen the point in how Vista goes into hibernation, and gets woken up again later. Things take forever to come back up. And if you changed anything while the computer was asleep, forget about it.

Example: Last night I was doing some work from home, finished, then put the computer to sleep. Never went back to it. This morning, I'm back in the office, put my laptop in the dock, and woke it up again. Everything was messed up, even to the point that basic USB devices like my keyboard and mouse weren't working. I ended up rebooting.

I pretty much just reboot Windows by default, rather than bother putting the laptop to sleep and waking it up again. It's too much bother to get Windows working again after things wake up. Really, it's not a useful feature if it takes me twice as long to get back to work by using Sleep Mode than if I'd just shut down the system and rebooted when I needed it.


  1. Now this is something where my times definitely do *not* match yours.

    I left Firefox running and hibernated. I then timed how long it took to resume from hibernation to the point where I could reload a web page. Again, the time is counted from pressing enter at the Grub screen to about when I can enter my password and about when it finishes loading a pagee.

    Windows 7:
    To login: 0:35
    To refresh: 0:55

    To login: 1:25
    To refresh: 1:55

    So basically, Windows resumes about twice as fast as Kubuntu on my system; I can be working on Windows before I would have had a login prompt on Linux.

    I didn't time XP since it'd have been annoying. (I'd have to actually shut down Windows 7 to boot XP, and that'd make me lose state; what I want is a way to hibernate Windows 7 and XP independently, but the Windows bootloader won't allow it. (It's not completely wrong; it'd be very easy to get into bad states if you allow that.) Last time I tried to get it to work a little bit I had to reload the Windows bootloader and then Grub.)

    Anyway, my subjective opinion is that XP would likely be closer to Windows 7 then to Kubuntu; resuming has always been pretty fast to me. I have Windows Server 2008 on my desktop, and that is about the same.

    (One sort of unfair comparison here is that the place where the OSes store their hibernate file is very different; I'm not sure how much -- if at all -- distance from the center of the platter affects bulk transfer rates, but it could. Don't take these numbers as a condemnation of Linux as a defense of Windows; the Windows speed is pretty good almost no matter what. An actually fair comparison would do much better to control for that sort of factor.)

    For me, resuming from sleep also probably goes in Windows's favor, though both cases are fast enough it's not a big deal. Kubuntu is probably subjectively right about what XP is, and Windows 7 is almost instant. (Again, fairness issues; I don't know what sleep states the OSes use.)

  2. Also, I'd be very curious where you're seeing Windows use "sleep" to describe hibernate... everywhere I've seen it I can remember, it's been the typical use (sleep for "suspend to RAM", hibernate for "suspend to disk").

    This includes Vista, though I do acknowledge that I've more or less only used that on a desktop that I left on 24/7 so didn't really pay attention to the suspend options.

  3. I have to wonder what Kubuntu is doing in evaned's example. When I suspend to RAM on openSUSE it takes maybe 5 seconds for the machine to return to a usable state, and there's no need to log in again. If I suspend to disk it takes a bit longer, probably upwards of 15 seconds (I'd be more exact but my laptop's not where I am). Unfortunately neither way is completely reliable - sometimes the machine hangs at resume - but at least it saves lots of time on average.


Note: Only a member of this blog may post a comment.