Bug 126155 - ImageBufferBackingStoreCache should use DeferrableOneShotTimer
Summary: ImageBufferBackingStoreCache should use DeferrableOneShotTimer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-23 03:31 PST by Tim Horton
Modified: 2014-01-02 16:07 PST (History)
3 users (show)

See Also:


Attachments
patch (4.39 KB, patch)
2013-12-23 03:46 PST, Tim Horton
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-12-23 03:31:00 PST
Right now, it uses plain old Timer, and reschedules it in every deallocate(), which can be very (very!) expensive (I'm seeing it at about 8% of main thread run time in my simple test case). That's why we have DeferrableOneShotTimer.

I have a patch.
Comment 1 Tim Horton 2013-12-23 03:46:42 PST
Created attachment 219905 [details]
patch
Comment 2 Tim Horton 2013-12-23 03:47:17 PST
Comment on attachment 219905 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219905&action=review

> Source/WebCore/platform/graphics/cg/ImageBufferBackingStoreCache.cpp:78
> +    {
> +    }

unindented obviously
Comment 3 Myles C. Maxfield 2014-01-02 11:17:41 PST
Comment on attachment 219905 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219905&action=review

> Source/WebCore/platform/graphics/cg/ImageBufferBackingStoreCache.cpp:32
> +static const double purgeInterval = 5;

shouldn't this be kPurgeInterval?

> Source/WebCore/platform/graphics/cg/ImageBufferBackingStoreCache.cpp:74
> +ImageBufferBackingStoreCache::ImageBufferBackingStoreCache()

Why did you move this into public?
Comment 4 Tim Horton 2014-01-02 11:22:48 PST
(In reply to comment #3)
> (From update of attachment 219905 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219905&action=review
> 
> > Source/WebCore/platform/graphics/cg/ImageBufferBackingStoreCache.cpp:32
> > +static const double purgeInterval = 5;
> 
> shouldn't this be kPurgeInterval?

I think you'll find that that's generally not the case, nor do I see anything in the style guide.

> > Source/WebCore/platform/graphics/cg/ImageBufferBackingStoreCache.cpp:74
> > +ImageBufferBackingStoreCache::ImageBufferBackingStoreCache()
> 
> Why did you move this into public?

I didn't.
Comment 5 Tim Horton 2014-01-02 16:07:13 PST
http://trac.webkit.org/changeset/161239