Re: Measuring power usage
David Rajchenbach-Teller wrote: > Context: I am currently working on patches designed to improve > performance of some subsystems in Firefox Desktop by decreasing disk > I/O, but I hope that they will also have an effect (hopefully > beneficial) on power/battery usage. I'd like to confirm/infirm that > hypothesis. > > Measuring and collecting performance improvement is relatively easy, > thanks to Telemetry. Measuring power usage, though? That looks harder. > > So, here are my questions: > - do we already have a good way to measure power usage by some thread > between two points in time? > - if not, would there be interest in developing a library for this > purpose ? Note that I don't even know if that's possible in userland. > - do we already have a good way to measure total power usage by a > xpcshell test, perhaps by interfacing with powertop or Intel Power Gadget? > > Cheers, > David Just to add some note on getting rather accurate energy usage numbers in general via software/CPU (though this might not help us/you in this case as it's quite special): Starting with Intel Sandy Bridge CPU generation you can read some special CPU register on Intel CPUs (in general this is called Intel RAPL), which counts up some kind of energy units (if I recall correctly one unit equals 15,7 nJ :-). From what I know this counter should be quite accurate, though I got that info only from some white paper. On Linux you can use the PAPI library to measure this, on Windows not sure. But then at least on Linux this requires admin privs (as you read from CPU registers), so this is only good for some testing/development work on your own box. I did not know the Intel Power Gadget tool up until now, but it looks like it might use those CPU registers. Frank ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Measuring power usage
You might be interested in bug 769431 where Intel modified power gadget to export symbols that the profiler can use to sample the power state and correlate it with execution. On Tue, Nov 5, 2013 at 11:02 AM, jmaher wrote: > I am working on using intel power gadget to measure the power usage. > Currently this is on windows with an idle test. Our test slaves have > older CPUs which do not support the intel power gadget. > ___ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Measuring power usage
On 11/5/13 4:49 PM, Andreas Gal wrote: > If you can access the remaining battery status of a large enough > population over time it should be easy to use telemetry to measure > this pre and post patch. > > Andreas > > Sent from Mobile. As it turns out, the platform currently offers an abstract notion of "battery level" as a number in [.0, 1.0] and/or discharging time. I believe that we would need something a bit closer to the metal, e.g. a number of W•s. I wonder if I should pursue this as a xpcom/js-ctypes library or whether we should work on extending the BatteryManager WebAPI. Note that I am interested in using it in workers. Any thought? Cheers, David -- David Rajchenbach-Teller, PhD Performance Team, Mozilla ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Measuring power usage
Hi David, On 05/11/2013 16:46, David Rajchenbach-Teller wrote: Context: I am currently working on patches designed to improve performance of some subsystems in Firefox Desktop by decreasing disk I/O, but I hope that they will also have an effect (hopefully beneficial) on power/battery usage. I'd like to confirm/infirm that hypothesis. if you think that these changes will have a measurable impact on Firefox OS too you might want to get in touch with Jon Hylands (jhyla...@mozilla.com). He built a remarkable harness to measure the power consumption of different FxOS devices directly. See his blog post about one of these harnesses: http://blog.huv.com/2013/09/so-up-until-month-ago-i-was-working-on.html More goodness on his Twitter feed: https://twitter.com/JonHylands Gabriele ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Measuring power usage
I am working on using intel power gadget to measure the power usage. Currently this is on windows with an idle test. Our test slaves have older CPUs which do not support the intel power gadget. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Measuring power usage
Good point. Just accessing the battery level is rather imprecise, but Telemetry + large numbers should help us see trends. If we go that way, this probably doesn't deserve a new library, but possibly a few utility functions in e.g. Telemetry or TelemetryStopwatch. Cheers, David On 11/5/13 4:49 PM, Andreas Gal wrote: > If you can access the remaining battery status of a large enough > population over time it should be easy to use telemetry to measure > this pre and post patch. > > Andreas > -- David Rajchenbach-Teller, PhD Performance Team, Mozilla ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Measuring power usage
If you can access the remaining battery status of a large enough population over time it should be easy to use telemetry to measure this pre and post patch. Andreas Sent from Mobile. > On Nov 5, 2013, at 16:46, David Rajchenbach-Teller > wrote: > > Context: I am currently working on patches designed to improve > performance of some subsystems in Firefox Desktop by decreasing disk > I/O, but I hope that they will also have an effect (hopefully > beneficial) on power/battery usage. I'd like to confirm/infirm that > hypothesis. > > Measuring and collecting performance improvement is relatively easy, > thanks to Telemetry. Measuring power usage, though? That looks harder. > > So, here are my questions: > - do we already have a good way to measure power usage by some thread > between two points in time? > - if not, would there be interest in developing a library for this > purpose ? Note that I don't even know if that's possible in userland. > - do we already have a good way to measure total power usage by a > xpcshell test, perhaps by interfacing with powertop or Intel Power Gadget? > > Cheers, > David > > -- > David Rajchenbach-Teller, PhD > Performance Team, Mozilla > ___ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Measuring power usage
Context: I am currently working on patches designed to improve performance of some subsystems in Firefox Desktop by decreasing disk I/O, but I hope that they will also have an effect (hopefully beneficial) on power/battery usage. I'd like to confirm/infirm that hypothesis. Measuring and collecting performance improvement is relatively easy, thanks to Telemetry. Measuring power usage, though? That looks harder. So, here are my questions: - do we already have a good way to measure power usage by some thread between two points in time? - if not, would there be interest in developing a library for this purpose ? Note that I don't even know if that's possible in userland. - do we already have a good way to measure total power usage by a xpcshell test, perhaps by interfacing with powertop or Intel Power Gadget? Cheers, David -- David Rajchenbach-Teller, PhD Performance Team, Mozilla ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform