Do
Now here’s the key difference for Windows 8: as in Windows 7, we close the user sessions, but instead of closing the kernel session, we hibernate it. Compared to a full hibernate, which includes a lot of memory pages in use by apps, session 0 hibernation data is much smaller, which takes substantially less time to write to disk. If you’re not familiar with hibernation, we’re effectively saving the system state and memory contents to a file on disk (hiberfil.sys) and then reading that back in on resume and restoring contents back to memory. Using this technique with boot gives us a significant advantage for boot times, since reading the hiberfile in and reinitializing drivers is much faster on most systems (30-70% faster on most systems we’ve tested).
It’s faster because resuming the hibernated system session is comparatively less work than doing a full system initialization, but it’s also faster because we added a new multi-phase resume capability, which is able to use all of the cores in a multi-core system in parallel, to split the work of reading from the hiberfile and decompressing the contents. For those of you who prefer hibernating, this also results in faster resumes from hibernate as well.
It’s probably worth mentioning quickly how we treat the hiberfile—if you read this and immediately went and did a dir /s /ah hiberfile.sys you would have found that it’s a pretty big file on disk. The hiberfile is sized by default at 75% of physical RAM. The file is essentially a reservation for hibernation data that will be written out as the system is dropping into hibernation. Typically much less space is actually used, and in the case of our fast startup usage, it’s typically ~10-15% of physical RAM but varies based on drivers, services, and other factors. The system also treats the hiberfile slightly differently than other files on disk, for example, the Volume Snapshot service ignores it (a small performance benefit.) You can disable hibernation and reclaim this space by running powercfg /hibernate off from an elevated command prompt. But be aware that if you do this, it will disable hibernation completely, including some nice capabilities like fast startup as well as hybrid sleep, which allows desktop systems to do both a sleep and hibernate simultaneously so if a power loss occurs you can still resume from the hibernated state. You can also run powercfg /hibernate /size and specify a value between 0 and 100 for the percentage of physical RAM to reserve for the hiberfile – but be careful! Specifying too small a size can cause hibernation to fail. In general, I recommend leaving it enabled at the default value unless you’re working on a system with extremely limited disk space.