How to find out what's causing a laptop to take too long to go to sleep?

Solution 1:

I've followed the instructions found in this forum to determine what was causing the problem. http://www.msfn.org/board/topic/158252-trace-why-windows-8-boots-shutsdown-or-hibernates-slowly/

It mostly talks about determining what takes time for bootup, but the same instructions apply for standby. It might be hard to follow the instructions though so I will go ahead and write what I did

I first downloaded the Windows 8.1 SDK from the following link, and made sure to install the Windows Performance Toolkit (you don't need to install anything else). The following link is for Windows 8.1 (if you have Windows 8 you need to search for the right SDK for Windows 8) http://msdn.microsoft.com/en-US/windows/desktop/bg162891

After installing the toolkit, I started the command prompt with administrator privelages (just search for cmd and rightclick and start with admin privelages)

Run the following command

xbootmgr -trace standby -traceFlags BASE+CSWITCH+DRIVERS+POWER -resultPath C:\TEMP

A popup will appear and your computer will go on standby. After you're sure it went to standby, if it doesn't wake up, wake it up. Wait for the popup to disappear. The trace for the standby process will all be stored in C:\TEMP but there will be way too much information so we need to "summarize" it

In the command prompt, go to C:\TEMP, and run the following command to create a summary XML file

xperf /tti -i standby_BASE+CSWITCH+DRIVERS+POWER_1.etl -o summary_stanby.xml -a suspend

A new XML file will show up. You can open it with a text editor or Internet Explorer or whatever XML editor you want. You will see under a few XML tags representing the different suspend steps that the system take. There's a tag for apps, services, superfetch, and devices, among others. The "Duration" attribute of the tags is what you're looking for, and by going through the XML you can find out what's causing the delay. The tags are conveniently sorted by duration.

In my case, I noticed that the WiFi driver was the culprit, take up more than an entire minute and a half (!!!) to suspend. To make sure, I disabled the WiFi driver in Device Manager, and tried closing the lid. Going to standby took only 3 seconds. I then updated the WiFi driver and surely enough the laptop standby time is now around 5 seconds as expected.

EDIT: Scratch that, updating the WiFi driver didn't fix the problem (garbage drivers I guess), but the problem is definitely the WiFi driver

Solution 2:

It was my memory card reader(even though it actually had no memory card inside it) that I had plugged in that was the culprit, after simply removing it sleep time returned to normal. So you might wanna check anything attached to the ports on your laptop!