[Webkit-unassigned] [Bug 153042] New: Windows system timer resolution needlessly cranked up when nextFireTime is in the past
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 12 15:47:26 PST 2016
https://bugs.webkit.org/show_bug.cgi?id=153042
Bug ID: 153042
Summary: Windows system timer resolution needlessly cranked up
when nextFireTime is in the past
Classification: Unclassified
Product: WebKit
Version: WebKit Nightly Build
Hardware: PC
OS: Windows 7
Status: NEW
Severity: Normal
Priority: P2
Component: Platform
Assignee: webkit-unassigned at lists.webkit.org
Reporter: jnlehner at yahoo.com
In http://trac.webkit.org/browser/trunk/Source/WebCore/platform/win/MainThreadSharedTimerWin.cpp
if MainThreadSharedTimer::setFireInterval() is called with an interval of 0, as will happen when ThreadTimers::updateSharedTimer() executes
m_sharedTimer->setFireInterval(std::max(nextFireTime - currentMonotonicTime, 0.0));
with nextFireTime in the past, then the following executes:
138 if (Settings::shouldUseHighResolutionTimers()) {
139 if (interval < highResolutionThresholdMsec) {
140 if (!highResTimerActive) {
141 highResTimerActive = true;
142 timeBeginPeriod(timerResolution);
143 }
highResolutionThresholdMsec is 16, so 0 < 16 and we call timeBeginPeriod(1) which stays in effect ~1/3 of a second. This increases power consumption needlessly.
We should only increase the system timer resolution if we're going to actually proceed to the CreateTimerQueueTimer() call; if we're going to PostMessage() immediately no resolution increase is necessary.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160112/689494c9/attachment-0001.html>
More information about the webkit-unassigned
mailing list