Bug 23467 - Optimize styleAvailable logic in AnimationController
Summary: Optimize styleAvailable logic in AnimationController
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-21 16:30 PST by Chris Marrin
Modified: 2009-03-02 11:51 PST (History)
1 user (show)

See Also:


Attachments
Patch (19.13 KB, patch)
2009-01-22 09:15 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 Chris Marrin 2009-01-21 16:30:28 PST
One of my tasks is to synchronize animations. To do this I will need to build a linked list of currently running animations so I can change them all at once at certain times. This got me to thinking about how the styleAvailable logic has these same characteristics (they need to get marked as waiting for something, and when that thing happens they all have to be notified at the same time). And I realized that keeping them in a list would be an optimization from having to walk through all CompositeAnimations looking for them. 

So I'm making this change now, both for the optimization and so I can do the same thing for the sync logic.
Comment 1 Chris Marrin 2009-01-22 09:15:09 PST
Created attachment 26926 [details]
Patch

       Change styleAvailable functionality to be a linked list
        rather than scanning every CompositeAnimation for 
        Animations that are waiting for styleAvailable. This has
        potential for large performance improvement in cases where
        there are many animations firing at once. But it will also
        help in my next fix, which is to synchronize software and
        accelerated animations.

        I also changed slightly when the beginAnimationUpdate and
        endAnimationUpdate calls are made. But this has no real
        effect on performance or behavior.
Comment 2 Dave Hyatt 2009-01-23 11:07:02 PST
Comment on attachment 26926 [details]
Patch

r=me
Comment 3 Chris Marrin 2009-01-24 07:10:48 PST
Sending        WebCore/ChangeLog
Sending        WebCore/dom/Document.cpp
Sending        WebCore/page/animation/AnimationBase.cpp
Sending        WebCore/page/animation/AnimationBase.h
Sending        WebCore/page/animation/AnimationController.cpp
Sending        WebCore/page/animation/AnimationController.h
Sending        WebCore/page/animation/CompositeAnimation.cpp
Sending        WebCore/page/animation/CompositeAnimation.h
Transmitting file data ........
Committed revision 40215.