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

Reply via email to