New issue
Advanced search Search tips

Issue 643348 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Oct 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Feature



Sign in to add a comment

Implement CPU throttling with sleep and hi-res timers instead of busy waiting

Project Member Reported by brucedaw...@chromium.org, Sep 1 2016

Issue description

The change in crrev.com/1977693002 to add CPU throttling to Windows also means that a devtools thread will be 100% busy, due to the limitations of timers on Windows. As the comment says, by default Sleep() on Windows has 16 ms granularity.

However, the global timer interrupt frequency can be changed easily to 1 kHz, giving 1 ms granularity. This would allow CPU throttling to not be such a CPU/battery hog.

timeBeginPeriod is the function to do this:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd757624(v=vs.85).aspx

It is even possible to raise the timer frequency on most machines to 2 kHz, although this is less useful since Sleep() still only has ms granularity in its parameters.

If the timer frequency is raised then it should be restored when the CPU throttling is finished because (perversely enough) having the timer frequency raised also increases CPU power usage slightly, just nowhere near as much as a busy loop.

Something to consider...
 
Summary: Implement CPU throttling with sleep and hi-res timers instead of busy waiting (was: Implement CPU throttling with sleep and hi-res timers)

Comment 2 by alph@chromium.org, Sep 1 2016

Indeed implementing a better approach is on my list. I'll use this CR for it. Thank you.

Comment 3 by alph@chromium.org, Dec 14 2016

Labels: Hotlist-Polish
Cc: brucedaw...@chromium.org
Labels: -Performance -Type-Bug Performance-Power OS-Windows Type-Feature
Status: Archived (was: Assigned)
Bulk closing low-priority issues with no activity. Please re-file and refer to the closed issue if it's essential to fix.

Sign in to add a comment