Closed Bug 1122435 Opened 9 years ago Closed 9 years ago

Reduce the devtools protocol traffic generated by the AnimationPlayerActor/Front

Categories

(DevTools :: Inspector: Animations, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 38

People

(Reporter: pbro, Assigned: pbro)

References

Details

Attachments

(2 files)

Animations are time-dependent, that's what they are, and so any devtools UI that wants to show the state of an animation (like the new Animation Inspector panel) is bound to have to regularly go via the protocol to know what's the state of the animation at the time.

The way the Animation Inspector panel does this now is it runs a loop to contact, at regular intervals, the current AnimationPlayerActor(s) and get its(their) state(s).
It's already a little bit optimized because the interval is rather slow, it doesn't need to run so often because the timeline widget progresses on its own using a local requestAnimationFrame loop, and only re-synchronize whenever the new state from the actor is retrieved.

In order to optimize this further, we can do 2 things:

- the actor could only send the state properties that have changed since the last update,
- the front could stop polling when the animation has ended.
I have 2 patches with tests for this. I'll attach them in a minute.
Assignee: nobody → pbrosset
Blocks: 1120900
Comment on attachment 8550191 [details] [diff] [review]
bug1122435-1-animation-actor-reduce-traffic v1.patch

Mike, here's the patch that makes the AnimationPlayerActor only sends the bits of the state that have changed since last time.
This is to reduce the traffic, as explained in this bug's first comment.
Attachment #8550191 - Flags: review?(mratcliffe)
And this second, simpler, patch makes the AnimationPlayerFront stop polling the actor once the animation has finished.
Attachment #8550193 - Flags: review?(mratcliffe)
Green try build for these patches: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8621430dff31
There's one weird dt failure that I'm going to consider as unrelated considering it occurs in other test directories and before the new test introduced here run.
Comment on attachment 8550191 [details] [diff] [review]
bug1122435-1-animation-actor-reduce-traffic v1.patch

Review of attachment 8550191 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for the delay in getting around to this... I have been trying to solve problem that turned out to be a platform issue.

Simple patch, r+.
Attachment #8550191 - Flags: review?(mratcliffe) → review+
Attachment #8550193 - Flags: review?(mratcliffe) → review+
No problem Mike, that's nothing very urgent. Thanks for the reviews!
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6b82dcac375f
https://hg.mozilla.org/mozilla-central/rev/3307b281be25
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
Component: Developer Tools: Inspector → Developer Tools: Animation Inspector
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: