Bug 23317 - [Regression] Very high CPU usage with animation testcase
Summary: [Regression] Very high CPU usage with animation testcase
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P1 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-14 06:59 PST by David Smith
Modified: 2009-01-21 17:11 PST (History)
2 users (show)

See Also:


Attachments
Testcase (639.98 KB, text/html)
2009-01-14 07:00 PST, David Smith
no flags Details
Shark trace (1.77 MB, application/octet-stream)
2009-01-14 07:02 PST, David Smith
no flags Details
Patch, including LayoutTest file (28.59 KB, patch)
2009-01-19 17:02 PST, Chris Marrin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2009-01-14 06:59:57 PST
Wave the mouse over the testcase (tested in r39882) and watch CPU usage, then compare doing the same in Safari 3.2.
Comment 1 David Smith 2009-01-14 07:00:46 PST
Created attachment 26707 [details]
Testcase
Comment 2 David Smith 2009-01-14 07:02:31 PST
Created attachment 26708 [details]
Shark trace
Comment 3 Chris Marrin 2009-01-19 17:02:38 PST
Created attachment 26853 [details]
Patch, including LayoutTest file

        The high CPU usage was really from repeatedly firing transitions caused
        by a bug in the way we handle background-color animations. If animating 
        from a valid background color to no background color, we sometimes left
        (based on timing) the background color as transparent black, but valid
        rather than invalid, which it should be. Fixing that got rid of the
        repeated firing.

        But we really were doing more expensive iteration of all objects with
        animations or transitions on them (running or not). So I added two
        optimizations to quickly short circuit when an object had no running
        animations or transitions. Things are now as zippy as ever.
Comment 4 Dave Hyatt 2009-01-21 12:53:11 PST
Comment on attachment 26853 [details]
Patch, including LayoutTest file

r=me
Comment 5 Chris Marrin 2009-01-21 17:11:03 PST
Sending        LayoutTests/ChangeLog
Adding         LayoutTests/transitions/repeated-firing-background-color-expected.txt
Adding         LayoutTests/transitions/repeated-firing-background-color.html
Sending        WebCore/ChangeLog
Sending        WebCore/page/animation/AnimationBase.cpp
Sending        WebCore/page/animation/AnimationController.cpp
Sending        WebCore/page/animation/CompositeAnimation.cpp
Sending        WebCore/page/animation/CompositeAnimation.h
Transmitting file data ........
Committed revision 40102.