04.17.07
Disable Hibernation for NUnit and Test Runner Performance
*Geek Alert*
I don’t usually blog about programming related stuff, but I stumbled across something today that made a big difference in performance on my computer. For a while now, I’ve been using NUnit and TestRunner with Visual Studio .NET 2005. Using these tools I’ve been able to deliver more stable releases with a greater level of confidence that my software will function properly. My greatest frustration with TestRunner and NUnit have been poor performance at times. I have a 1.83 GHz dual core CPU and 2 GB of RAM, so I’ve been wondering why I would experience such sluggishness.
For a totally unrelated reason, I recently changed my Windows Explorer folder options to make hidden system files visible. When I did this, I noticed a file in C:\ called hiberfil.sys. I figured this had something to do with the hibernation capability of Windows. The file size was 2 GB, exactly the same size as my memory. I had an epiphany, realizing that this file was probably being updated regularly to enable me to hibernate my computer.
So, when did I last hibernate my laptop? Umm… Never! So, I opened up the “Power Options” window in my control panel, selected the “Hibernate” tab and unchecked the “Enable hibernation” checkbox. The hiberfil.sys file in C:\ magically disappeared.
I continued my work day, and a while later noticed that my NUnit tests were running much more quickly. TestRunner was blazing through my unit tests and performance metrics at about 50-80% faster speeds. It took me a few minutes to figure out what it could have been that caused the performance increase, but then I realized it was related to shutting off the Hibernate “feature” of windows.
I’m guessing that most people never use hibernation. Even if people don’t use it, if the primary use of a computer is word processing and ‘net surfing, then any performance hit is probably negligible. But for memory intensive operations (hmm… like unit testing?) that hibernation file seems to incur a large performance hit.
So, to all you computer users out there (programmers or not), I’d recommend that you shut of hibernation as well, unless you actually use it.

