Summary: | Throw away StyleResolvers that haven't been used for a long time. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||
Component: | CSS | Assignee: | Andreas Kling <kling> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | allan.jensen, cmarcelo, macpherson, menard, ojan.autocc, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Andreas Kling
2012-12-06 16:23:14 PST
Created attachment 178104 [details]
Proposed patch
Comment on attachment 178104 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=178104&action=review > Source/WebCore/dom/Document.cpp:4446 > + // Throttle the calls to startOneShot() a bit since it's non-trivial on some platforms. > + if (now > m_lastStyleResolverAccessTime + 5) { > + m_styleResolverThrowawayTimer.startOneShot(60); > + m_lastStyleResolverAccessTime = now; > + } Please use named constants. Created attachment 178201 [details]
Land crab
Comment on attachment 178201 [details] Land crab Clearing flags on attachment: 178201 Committed r136956: <http://trac.webkit.org/changeset/136956> All reviewed patches have been landed. Closing bug. Comment on attachment 178201 [details] Land crab View in context: https://bugs.webkit.org/attachment.cgi?id=178201&action=review > Source/WebCore/dom/Document.cpp:4441 > + static const int timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds = 60; > + static const int holdOffTimeBeforeReschedulingTimerInSeconds = 5; Is it really important that these times be different? If not, you could make m_styleResolverThrowawayTimer a DeferrableOneShotTimer. Then this entire function would just be one line: m_styleResolverThrowawayTimer.restart(); (In reply to comment #6) > (From update of attachment 178201 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=178201&action=review > > > Source/WebCore/dom/Document.cpp:4441 > > + static const int timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds = 60; > > + static const int holdOffTimeBeforeReschedulingTimerInSeconds = 5; > > Is it really important that these times be different? If not, you could make m_styleResolverThrowawayTimer a DeferrableOneShotTimer. Then this entire function would just be one line: > m_styleResolverThrowawayTimer.restart(); I was not aware of DeferrableOneShotTImer. I'll post a patch to use that instead, thanks! |