سؤال

I was wondering if there exist power profiling tool for programs which reports results at source code level. For example, profiling results which report the power consumption at specific source code lines, functions, modules, etc.

For me is not important the language and platform. Just want to know if there is such animal.

هل كانت مفيدة؟

المحلول

There is research being done on this right now at universities, but it’s still in an experimental stage, and I’m not aware of commercial tools for this yet.

A professor at my alma mater is working on this, and he calls it Green Mining: The Effect of Software Change on Power Consumption. Right now it involves hooking up a Kill-a-Watt with USB to another computer and recording lots of data while running controlled tests on the software. For mobile devices it gets even more complicated, because you have to wire up circuit boards to measure the power drain on the battery in real time:

mobile phone power monitoring setup

Eventually there will be statistical models that, based on data gathered by running power tests over all sorts of other code, will be able to give you power profiles of source code without all this hardware. Your IDE will warn you: “Are you sure you want to do that? That will reduce average laptop battery life by 3 minutes compared to this other way of doing it.” That is a very long way off, though.

I do vaguely remember hearing that one of the initial results was that the depth of the class inheritance hierarchy is positively correlated with power consumption … Browse these papers if you’re interested!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top