RESOLVED FIXED 194135
Use deferrable timer to restart the Responsiveness Timer on each wheel event
https://bugs.webkit.org/show_bug.cgi?id=194135
Summary Use deferrable timer to restart the Responsiveness Timer on each wheel event
Benjamin Poulain
Reported 2019-01-31 18:48:09 PST
Use deferrable timer to restart the Responsiveness on each wheel event
Attachments
Patch (13.02 KB, patch)
2019-01-31 20:40 PST, Benjamin Poulain
no flags
Patch (14.38 KB, patch)
2019-02-01 16:19 PST, Benjamin Poulain
no flags
Archive of layout-test-results from ews107 for mac-highsierra-wk2 (2.58 MB, application/zip)
2019-02-01 18:36 PST, EWS Watchlist
no flags
Patch (15.68 KB, patch)
2019-02-01 19:02 PST, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2019-01-31 20:40:56 PST
Benjamin Poulain
Comment 2 2019-01-31 20:42:40 PST
@Simon: that was a really good idea. I could not use Deferrable timers directly but a simple variant makes everything work. I'll test tomorrow that everything still works as expected. The perf looks great though.
Benjamin Poulain
Comment 3 2019-02-01 16:19:26 PST
Benjamin Poulain
Comment 4 2019-02-01 16:20:27 PST
Ok, this time I verified responsiveness still works as expected. I found more cases to improve during testing. I'll do a follow up patch since it's a bit unrelated with this optimization.
Simon Fraser (smfr)
Comment 5 2019-02-01 17:25:12 PST
Comment on attachment 360922 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=360922&action=review > Source/WebCore/ChangeLog:3 > + Use deferrable timer to restart the Responsiveness on each wheel event "the Responsiveness"? > Source/WebCore/ChangeLog:17 > + created a real DeferrableOneShotTimer that support dealines. deadlines > Source/WebCore/platform/Timer.cpp:554 > +void DeferrableOneShotTimer::stop() > +{ > + TimerBase::stop(); > +} Can you just remove this? > Source/WebCore/platform/Timer.h:204 > +class WEBCORE_EXPORT DeferrableOneShotTimer : private TimerBase { I think you need some comments explaining the difference between DeferrableOneShotTimer and ResettableOneShotTimer. How are devs supposed to know which one to use?
EWS Watchlist
Comment 6 2019-02-01 18:36:44 PST
Comment on attachment 360922 [details] Patch Attachment 360922 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/11001806 New failing tests: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
EWS Watchlist
Comment 7 2019-02-01 18:36:46 PST
Created attachment 360944 [details] Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
Benjamin Poulain
Comment 8 2019-02-01 19:02:01 PST
Benjamin Poulain
Comment 9 2019-02-01 19:05:44 PST
I added some documentation. Tell me what you think. > > Source/WebCore/platform/Timer.cpp:554 > > +void DeferrableOneShotTimer::stop() > > +{ > > + TimerBase::stop(); > > +} > > Can you just remove this? Unfortunately no. I can't inherit TimerBase publicly since I can't expose the other methods.
Simon Fraser (smfr)
Comment 10 2019-02-02 12:03:09 PST
Comment on attachment 360946 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=360946&action=review > Source/WebCore/ChangeLog:11 > + The original DeferrableOneShotTimer was not really deferrable. > + What it allows is to restart the count down from scratch after > + firing. That actually surprised me. I wonder if we actually need both types. DeferrableOneShotTimer came in via https://trac.webkit.org/changeset/118942/webkit.
Benjamin Poulain
Comment 11 2019-02-02 20:27:17 PST
(In reply to Simon Fraser (smfr) from comment #10) > That actually surprised me. I wonder if we actually need both types. Me too. It seems like a very odd way to use a timer... I can try a follow up where I get rid of ResettableOneShotTimer but that seems a bit risky given the variety of uses :(
Darin Adler
Comment 12 2019-02-03 11:22:21 PST
If we feel that DeferrableOneShotTimer is not a good name for the class that currently has that name, I think we should rename for clarity, even if we later decide to get rid of it for economy.
Benjamin Poulain
Comment 13 2019-02-04 14:05:42 PST
Comment on attachment 360946 [details] Patch Thanks for the review!
WebKit Commit Bot
Comment 14 2019-02-04 14:30:37 PST
Comment on attachment 360946 [details] Patch Clearing flags on attachment: 360946 Committed r240944: <https://trac.webkit.org/changeset/240944>
WebKit Commit Bot
Comment 15 2019-02-04 14:30:39 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.