RESOLVED FIXED 118150
Use DeferrableOneShotTimer for deleting decoded data
https://bugs.webkit.org/show_bug.cgi?id=118150
Summary Use DeferrableOneShotTimer for deleting decoded data
Antti Koivisto
Reported 2013-06-27 14:45:26 PDT
When loading apple.com/itunes CachedScript::script() takes ~1% of the web thread time, most of which is under system timer code. We should use DeferrableOneShotTimer instead of plain Timer as that avoids unnecessary low level timer access.
Attachments
patch (5.10 KB, patch)
2013-06-27 15:11 PDT, Antti Koivisto
no flags
patch (5.98 KB, patch)
2013-06-27 17:06 PDT, Antti Koivisto
kling: review+
don't call virtual in constructor (4.18 KB, patch)
2013-07-01 06:10 PDT, Antti Koivisto
kling: review+
Antti Koivisto
Comment 1 2013-06-27 15:11:51 PDT
Antti Koivisto
Comment 2 2013-06-27 15:12:47 PDT
Simon Fraser (smfr)
Comment 3 2013-06-27 16:07:15 PDT
Comment on attachment 205640 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=205640&action=review > Source/WebCore/platform/Timer.h:158 > + void setDelay(double delay) { m_delay = delay; } setDelay() seems ambiguous here; does it reschedule the current timer? What does it mean to just change the delay like this?
Antti Koivisto
Comment 4 2013-06-27 17:06:35 PDT
Created attachment 205648 [details] patch Remove the confusing delay setter, instead use a virtual function to vary the delay constructor argument.
Andreas Kling
Comment 5 2013-06-27 18:31:42 PDT
Comment on attachment 205648 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=205648&action=review r=me > Source/WebCore/ChangeLog:35 > + Avoid unnecessary restart after stopping and starting again. Nice ninja fix.
Simon Fraser (smfr)
Comment 6 2013-06-27 18:36:28 PDT
Comment on attachment 205648 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=205648&action=review > Source/WebCore/loader/cache/CachedResource.cpp:894 > +double CachedResource::decodedDataDeletionTimerDelay() const > +{ > + return memoryCache()->deadDecodedDataDeletionInterval(); > +} Shame that one is called an interval, and the other a delay.
Antti Koivisto
Comment 7 2013-06-27 19:01:46 PDT
Adam Barth
Comment 8 2013-06-28 16:16:48 PDT
Comment on attachment 205648 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=205648&action=review > Source/WebCore/loader/cache/CachedScript.h:60 > + virtual double decodedDataDeletionTimerDelay() const OVERRIDE; Does this do what you mean? You're calling decodedDataDeletionTimerDelay() in the CachedResource construct, which means you'll get the implementation from the base class because the CachedScript constructor hasn't run yet.
Antti Koivisto
Comment 9 2013-07-01 05:29:24 PDT
Good point. It is indeed wrong.
Antti Koivisto
Comment 10 2013-07-01 06:10:22 PDT
Created attachment 205803 [details] don't call virtual in constructor
Andreas Kling
Comment 11 2013-07-01 06:17:45 PDT
Comment on attachment 205803 [details] don't call virtual in constructor View in context: https://bugs.webkit.org/attachment.cgi?id=205803&action=review Oh wow, now I feel stupid. :| > Source/WebCore/loader/cache/CachedResource.cpp:185 > +static double decodedDataDeletionTimerDelayForResourceType(CachedResource::Type type) We should call this deadDecodedDataDeletionIntervalForResourceType() to match the MemoryCache function.
Antti Koivisto
Comment 12 2013-07-01 06:28:38 PDT
Note You need to log in before you can comment on or make changes to this bug.