Monday, June 10, 2013

Let's teach battery perservation in Computer Science

In a society that is increasingly moving towards always-on mobile ubiquity, graduates of computer science degrees can be trained to write code that dramatically saves battery life. Mobile technology is affordable, and it is easy to teach about battery consumption when learning to code.

Apple's OSX Maverick unveiled at WWDC today unveiled a battery preservation technology that has been available in Windows for about 4 years. Timer Coalescing combines disparate background tasks onto the same clock cycle so that the CPU spends more time idling. As explained from Apple's whitepaper, it synchronizes thread processing to increase CPU idle time.

Before Timer Coalescing


After Timer Coalescing

While energy saving hardware has advanced significantly in recent years, software development techniques remain relatively unchanged. Clay Bershear's post on energy efficient programming talks about how programmers can save power with vector operations, limiting loop increment complexity, and simpler code. Power consumption simulators such as ENERJ will allow developers to understand how much power their software consumes during development. Companies are also documenting exactly how much power each operation consumes.
I was once told that a prominent GPU producer had measured the amount of energy that every operation (computation, access to memory, moving data in from off-card, etc.) took on its products.
I could see programming assignments for creating an algorithm that sorts 10K random items with less than 0.1W of power. Or an JPEG compressor that uses less than 0.5W per 15 megapixel bitmap.

I'd love to hear what ideas can you think of.

2 comments:

Chris said...

Google has a few recommendations for data transfer on Android devices. Since powering up the radio to do a transfer could draw power for up to 20 seconds, they recommend waiting if you do not need to immediately send. Batching up your transfers until you have enough to make it worth it. If the radio is fully powered for 20 seconds, a 1 second transfer wastes a lot of energy.

Chris said...

Lesson 1: research all of the different battery types and their battery preservation preferences (that should keep students busy for about a year)

Lesson 2: document the past and currently evolving understanding (sifting out what is said by the likes of Apple, Sony, etc in order to sell their devices) of Lithium Ion's battery preservation preferences. That should keep students busy for another year.