Readit News logoReadit News
fzaninotto · 4 years ago
These tools are great, but aren't enough to get a full picture, and not accurate enough to give actionable insights.

Most of the quoted tools measure the CPU or GPU consumption. But in a laptop, about half of the energy consumption comes from the screen. And the consumption computers & smartphones represents only 20% of the CO2 emitted by digital activities - the vast majority lies elsewhere, in networks, in datacenters, or in the factories manufacturing the devices. So the tools of this article give an idea of only 10% of the digital energy consumption (source: https://theshiftproject.org/en/article/lean-ict-our-new-repo...)

Besides, measuring the consumption of computer doesn't isolate the contribution of one program, and / or doesn't provide enough granularity to help developers understand what to optimize first. If you have ever tried to use one of these to reduce the actual consumption of a software, you've probably hit a wall. Isolation, reproducibility and granularity aren't yet enough to make these tools suitable for software engineers.

Worse, focusing on the computer consumption may push web developers to just move computations to the server side, where the energy consumption is not measured. This will lead to an apparent drop on the client-side consumption, but does the overall system footprint decreases?

One solution is to use docker to isolate processes, docker-compose to reproduce the client, network and server in a lab, docker stats to get system metrics, and academic papers to turn these metrics (CPU, network and disk I/O, memory) into Watt.hours or Joules. It works in theory, but in practice it requires a lot of engineering to get a good reproducibility and accuracy.

I've spend a year and a half on this subject, and the results of these efforts can be tested at GreenFrame.io. Many web developers already use it in their CI to monitor and reduce their energy emissions.

tjoff · 4 years ago
> Worse, focusing on the computer consumption may push web developers to just move computations to the server side, where the energy consumption is not measured.

HALLELUJAH! It sure is measured. If web developers where a fraction of as wasteful with server resources as they are with client resources the world would instantly be measurably better for it.

I'd bet that a significant portion of the energy and waste from computers are from viewing ads. And the only reason it exists is because those responsible don't pay for it. Suddenly, they would need far more servers. Which costs money, incentivizing them to be resourceful.

Seriously, because of the web the absolute vast majority of devices with a battery that touches javascript will have to be thrown away at least a year before its time due to battery degrading and CPU not keeping up with the bloated web.

matheusmoreira · 4 years ago
> I'd bet that a significant portion of the energy and waste from computers are from viewing ads.

Yet another reason to block all ads and make no exceptions. Advertising itself should probably be banned.

thefr0g · 4 years ago
> Worse, focusing on the computer consumption may push web developers to just move computations to the server side, where the energy consumption is not measured.

Server side energy consumption is directly measured by how much money it costs to run the servers. The only reason web devs waste client processing power like there is no tomorrow is that it doesn't cost anything.

Kliment · 4 years ago
> Worse, focusing on the computer consumption may push web developers to just move computations to the server side, where the energy consumption is not measured. This will lead to an apparent drop on the client-side consumption, but does the overall system footprint decreases?

This may be a net win even if net power usage is the same because client devices are more likely to be battery constrained

dmytton · 4 years ago
Also worth a mention is that Mozilla provide some cross-platform power monitoring tools as part of Firefox which you can build and run yourself:

https://firefox-source-docs.mozilla.org/performance/tools_po...

and a good description of how power consumption actually happens: https://firefox-source-docs.mozilla.org/performance/power_pr...

tigerlily · 4 years ago
Excellent precis. Recently I've been wondering what tools to apply to the PinePhone to monitor power consumption and optimize its battery life.
relyks · 4 years ago
This made me think: On a smaller scale, should code that uses more efficient algorithms and data structure in terms of computational complexity (both time and space) also be more efficient in terms of energy usage? If the code in its most frequent use cases uses less instructions and memory swaps, wouldn't that lead to less energy usage?
gameswithgo · 4 years ago
The fastest code is almost always the most energy efficient code yes. Not a perfect correlation but close.
a-dub · 4 years ago
for systems that use modeling that was built using measurement hardware, and then are able to make predictions without the hardware for android, also see:

A. Pathak, et, al, “Fine- grained power modeling for smartphones using system call tracing,” http://doi.acm.org/10.1145/1966445.1966460

L. Zhang, et, al. “Accurate online power estimation and automatic battery behavior based power model generation for smartphones”

i think that some android platform dev boards also have specialized hardware and that qualcomm has a whole system for measuring baseband energy usage.

Darvon · 4 years ago
Or, I mean, hear me out: buy a Kill-A-Watt for $50, plug it into the wall, and then check what the dial says when your computer is neutral vs. when it's looping your code.
beebeepka · 4 years ago
While better than calorie counting apps, accurately measuring power usage purely through software would require all kinds of other metrics that only manufacturers would know.
zekrioca · 4 years ago
All these software depend on proprietary interfaces (Intel RAPL (oldest), Nvidia, Android..)

Wondering how to do the same for RPi’s?

eric__cartman · 4 years ago
For starters you could always measure the power consumption that the Pi pulls from the USB power supply. As long as you don't change many variables when comparing software (like plugging in additional peripherals) it should be a decent way to get an idea of the power draw of the whole system under different circumstances.

Or just measure the CPU usage and naively assume that lower CPU usage always means lower power draw.

wmf · 4 years ago
There are no standard interfaces for power measurement. Given the cost-cutting philosophy behind RPi I assume the relevant sensors simply aren't there.
zekrioca · 4 years ago
Maybe we could use software for emulating such sensors.