Zune battery versus hard drive

Originally posted to Shawn Hargreaves Blog on MSDN, Friday, December 26, 2008

I made it back from a fantastic vacation in Thailand to find Seattle covered in snow.

I'm pleased to report that my attempts at making a battery efficient Zune game worked out pretty well. On the return flight I listened to music for 8 hours, while playing my Freecell game for at least 2, yet arrived home with juice to spare.

But this was on my 8 gig flash memory Zune. Tracy's 30 gig hard drive model did not last so long.

It makes sense that a hard drive would consume more power than a flash memory device. One uses an electric motor to spin a physical platter, while the other just needs a handful of electrons to access a microchip.

This reminded me of another important thing to consider when optimizing for battery efficiency. The hard drive burns power like you can't believe! If you don't access it for more than a couple of seconds the OS will put it to sleep and shut off the motor, but any time you do disk IO the motor has to spin up again, which consumes an enormous amount of power.

So, avoid reading files piece by piece as the player moves around a level. It will use far less power if you load everything up front, then let the hard drive go to sleep. Also, avoid updating your save files too often. Don't write out statistics every time the player gets a kill: instead, cache the data in memory and just flush it to disk once at the end of the level.

Blog index   -   Back to my homepage