Windows Timer Resolution: Megawatts Wasted
randomascii.wordpress.com
randomascii.wordpress.com
At the same time, PowerTOP [2] will nicely show you which programs or drivers are responsible for waking up the computer and estimate how much power each program is consuming.
[1] https://lwn.net/Articles/549580/ [2] https://01.org/powertop/
http://arstechnica.com/information-technology/2012/10/better...
YMMV
I run TLP, turn of my ethernet and wifi when not using them, and otherwise try to save power. Windows users do none of these things, yet they still seem to get okay battery life.
It does beg the question... if the problem isn't in the kernel but in userland, what is the issue, and can something be done?
I will gladly give money to someone who will work on figuring this out.
The power efficiency tends to be very good on server-class hardware (because large corporate users like Google tend to care a lot about it).
I wonder how much javascript code uses setTimeout(x,0) to push code to the end of the run loop.
Probably heaps, but why would that cause the system-wide timer to run more frequently? Even if it does need to it should only be temporary.
This bug (helpfully linked from MDN) has more of the story. https://code.google.com/p/chromium/issues/detail?id=792
I remember the Chrome timer code of years ago was careful to only adjust the interval when needed. From reading other bugs it looks like today's behavior is an accidental regression and will likely be fixed (until the next time it regresses).
I was playing with Windows timers a little while ago and I noticed that with IE11 open the timer interval sat at 15.6ms, occasionally changing to 4ms while the page was doing things. That was the first time I've heard of a program calling timeBeginPeriod without setting it to 1ms. I hope it catches on.
Indeed, although it seems the current behavior has been oustanding for some time:
https://code.google.com/p/chromium/issues/detail?id=153139
The original justification for lowering the resolution is an interesting read:
At one point during our development, we were about to give up on using the high resolution timers, because they just seemed too scary. But then we discovered something. Using WinDbg to monitor Chrome, we discovered that every major multi-media browser plugin was already using this API. And this included Flash, Windows Media Player, and even QuickTime. Once we discovered this, we stopped worrying about Chrome's use of the API. After all – what percentage of the time is Flash open when your browser is open? I don't have an exact number, but it's a lot. And since this API effects the system globally, most browsers are already running in this mode.[1]
[1] http://www.belshe.com/2010/06/04/chrome-cranking-up-the-cloc...
https://developer.mozilla.org/en-US/docs/Web/API/window.requ...
On my machine, I got similar settings and found chrome being the sole offender which is probably the worst offender in many ways. Firefox and IE were clean so Google is the outlier and given I always have Chrome browser open somewhere while SQL or devenv is not always open, I suppose that's suboptimal wonder if they will change it.
In my PC the programs raising the resolution are gtalk, chrome and skype. I run visual studio and sql server but they don't show up in powercfg.
quartz.dll is from DirectShow. A multimedia component is expected to requiere more resolution. The fault is in the program calling into DirectShow.
Is this attitude still prevalent in the windows community? I thought things had improved on that front.
Its worth pointing out that "the highest frequency wins" is not an example of "tragedy of the commons."
(I'm just kidding; of course it does. We meet monthly and talk about ways to snuff out free software, as is our way).
.. and there are practices that are commonly found on windows programming that are beyond the pale in other environments (loading your app into memory every time the machine starts, installing malware during setup, etc).
An old colleague used to joke: "Developers should never have fast machines". Point being, they'll appreciate every spare CPU cycle and byte of memory available.
If we take his claim that 10 MW is being wasted, then the energy wasted at 10 MJs⁻¹ over a year is the energy of 5 small atomic bombs.
Scary numbers though even if they are ballpark figures.
http://www.wolframalpha.com/input/?i=10MW+times+a+year+divid...
Ratios matter, large numbers without a relevant basis for comparison on the other hand are just misleading. There are roughly 116 million households in the US, saving the energy of 7,500 is not a big change.
You're solving roughly 1 - 15,466 th of the problem. And that's assuming that all the savings could even be applied to the US, which they most certainly couldn't.
That's not a big impact. Chances are no-one - even if they were looking - could notice the figurative needle move on a change that small at all the power-stations serving the aggregated demand.
if(comment.onTopic)){
comment.post()
} else {
comment.delete()
}