Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Issue 1261993006: Fix the drift in repeating timers. (Closed)

Created:
5 years, 4 months ago by alex clarke (OOO till 29th)
Modified:
5 years, 4 months ago
CC:
blink-reviews, dglazkov+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix the drift in repeating timers. Currently repeating blink timers ignore the difference between when the timer was due to fire and when it actually did. In addition the delay reported to chromium was rounded up to the nearest millisecond, introducing unnecessary extra delay. (Note seperatly DOMTimers have additional clamping). This fairly broken behaviour has been there for a long time, and I really hope nothing has come to depend on it! Judging by http://www.duckware.com/test/chrome/timeraccuracy.html this patch makes things a lot better at least on linux. The actual delays are much closer to the requested ones, and the run time modulo interval shows the drift is gone. BUG=328700 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=199903

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fixed tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -41 lines) Patch
M Source/platform/Timer.cpp View 2 chunks +9 lines, -10 lines 0 comments Download
M Source/platform/TimerTest.cpp View 1 26 chunks +90 lines, -30 lines 0 comments Download
M public/platform/WebScheduler.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (2 generated)
alex clarke (OOO till 29th)
5 years, 4 months ago (2015-07-31 16:56:54 UTC) #2
Sami
https://codereview.chromium.org/1261993006/diff/1/Source/platform/Timer.cpp File Source/platform/Timer.cpp (right): https://codereview.chromium.org/1261993006/diff/1/Source/platform/Timer.cpp#newcode129 Source/platform/Timer.cpp:129: double intervalToNextFireTime = m_repeatInterval - fmod(now - m_unalignedNextFireTime, m_repeatInterval); ...
5 years, 4 months ago (2015-08-03 12:57:21 UTC) #3
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/1261993006/diff/1/Source/platform/Timer.cpp File Source/platform/Timer.cpp (right): https://codereview.chromium.org/1261993006/diff/1/Source/platform/Timer.cpp#newcode129 Source/platform/Timer.cpp:129: double intervalToNextFireTime = m_repeatInterval - fmod(now - m_unalignedNextFireTime, ...
5 years, 4 months ago (2015-08-03 13:37:27 UTC) #4
Sami
On 2015/08/03 13:37:27, alexclarke1 wrote: > PTAL > > https://codereview.chromium.org/1261993006/diff/1/Source/platform/Timer.cpp > File Source/platform/Timer.cpp (right): > ...
5 years, 4 months ago (2015-08-03 15:44:32 UTC) #5
jochen (gone - plz use gerrit)
lgtm
5 years, 4 months ago (2015-08-03 15:49:45 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261993006/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261993006/20001
5 years, 4 months ago (2015-08-03 15:55:08 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=199903
5 years, 4 months ago (2015-08-03 17:21:43 UTC) #9
jam
5 years, 4 months ago (2015-08-12 03:11:15 UTC) #10
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.chromium.org/1290633002/ by jam@chromium.org.

The reason for reverting is: this change caused a large amount of flakes, see
https://code.google.com/p/chromium/issues/detail?id=517488

and also graphs on 
http://chrome-monitor.appspot.com/view_graph/tryserver.chromium.linux%20Build...
http://chrome-monitor.appspot.com/view_graph/tryserver.chromium.win%20Builder...
http://chrome-monitor.appspot.com/view_graph/tryserver.chromium.win%20Builder...

this was hard to track down because browser_tests weren't printing renderer
crashes. i fixed that in an unlanded cl and tried reenabling all the tests and
they all had
ASSERTION FAILED: now >= m_unalignedNextFireTime
see the try runs on this patchset
https://codereview.chromium.org/1284083002/#ps20001
i.e. one example:
http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...

BUG=517488.

Powered by Google App Engine
This is Rietveld 408576698