Bug 96224 - Refactor SMILTimeContainer::updateAnimations to not do extra work
Summary: Refactor SMILTimeContainer::updateAnimations to not do extra work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philip Rogers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-09 21:05 PDT by Philip Rogers
Modified: 2012-09-10 17:07 PDT (History)
2 users (show)

See Also:


Attachments
Remove unnecessary codepaths in SMILTimeContainer::updateAnimations (17.36 KB, patch)
2012-09-09 21:12 PDT, Philip Rogers
zimmermann: review+
Details | Formatted Diff | Diff
Patch for landing (17.44 KB, patch)
2012-09-10 14:10 PDT, Philip Rogers
webkit.review.bot: review-
pdr: commit-queue+
Details | Formatted Diff | Diff
Lets try this again... (17.44 KB, patch)
2012-09-10 14:13 PDT, Philip Rogers
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Rogers 2012-09-09 21:05:46 PDT
SMILTimeContainer::updateAnimations is hot for users with many simultaneous animations and it contains some low hanging fruit for improving code readability and reducing unnecessary codepaths.
Comment 1 Philip Rogers 2012-09-09 21:12:18 PDT
Created attachment 163033 [details]
Remove unnecessary codepaths in SMILTimeContainer::updateAnimations
Comment 2 Nikolas Zimmermann 2012-09-09 23:45:56 PDT
Comment on attachment 163033 [details]
Remove unnecessary codepaths in SMILTimeContainer::updateAnimations

Looks good, r=me!
Comment 3 Stephen Chenney 2012-09-10 13:53:19 PDT
Comment on attachment 163033 [details]
Remove unnecessary codepaths in SMILTimeContainer::updateAnimations

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

> Source/WebCore/svg/animation/SMILTimeContainer.cpp:249
>  

I would like to see an else on this asserting that the resultElement != animation. Because if it is equal, you may be adding it twice to the resultElements below.

> Source/WebCore/svg/animation/SMILTimeContainer.cpp:251
> +        if (animation->progress(elapsed, resultElement, seekToTime) && resultElement == animation)

If resultElement was already animation at line 243 above, then we might be adding it again here. I think that here you should be checking accumulatedResultElement instead of resultElement == animation.
Comment 4 Philip Rogers 2012-09-10 14:03:14 PDT
Comment on attachment 163033 [details]
Remove unnecessary codepaths in SMILTimeContainer::updateAnimations

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

Thanks for the review schenney!

>> Source/WebCore/svg/animation/SMILTimeContainer.cpp:249
>>  
> 
> I would like to see an else on this asserting that the resultElement != animation. Because if it is equal, you may be adding it twice to the resultElements below.

An assert that this doesn't happen seems useful. Adding in new patch momentarily

>> Source/WebCore/svg/animation/SMILTimeContainer.cpp:251
>> +        if (animation->progress(elapsed, resultElement, seekToTime) && resultElement == animation)
> 
> If resultElement was already animation at line 243 above, then we might be adding it again here. I think that here you should be checking accumulatedResultElement instead of resultElement == animation.

I think the new assert from your other comment will cover this case without the extra bool.
Comment 5 Philip Rogers 2012-09-10 14:10:21 PDT
Created attachment 163206 [details]
Patch for landing

Thank you for the review Nikolas!

Patch: off to the commit queue you go.
Comment 6 WebKit Review Bot 2012-09-10 14:11:53 PDT
Comment on attachment 163206 [details]
Patch for landing

Rejecting attachment 163206 [details] from review queue.

pdr@google.com does not have reviewer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have reviewer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have reviewer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your reviewer rights.
Comment 7 Philip Rogers 2012-09-10 14:13:30 PDT
Created attachment 163207 [details]
Lets try this again...

Oops--marked as r+ but I should have left review blank so it would pick up Niko's r+.
Comment 8 WebKit Review Bot 2012-09-10 17:07:05 PDT
Comment on attachment 163207 [details]
Lets try this again...

Clearing flags on attachment: 163207

Committed r128131: <http://trac.webkit.org/changeset/128131>
Comment 9 WebKit Review Bot 2012-09-10 17:07:08 PDT
All reviewed patches have been landed.  Closing bug.