Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upscript: Avoid needless `ChangeRunningAnimationsState` messages during typical `requestAnimationFrame()` animations. #11205
Conversation
highfive
commented
May 16, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
May 16, 2016
|
r? @jdm |
components/script/dom/document.rs
Outdated
| @@ -201,6 +201,7 @@ pub struct Document { | |||
| /// List of animation frame callbacks | |||
| #[ignore_heap_size_of = "closures are hard"] | |||
| animation_frame_list: DOMRefCell<BTreeMap<u32, Box<FnBox(f64)>>>, | |||
| running_animation_callbacks: Cell<bool>, | |||
This comment has been minimized.
This comment has been minimized.
|
r=me with documentation added. |
|
@bors-servo: r=jdm |
|
|
|
@bors-servo: r- |
02ab54a
to
8a83261
highfive
commented
May 17, 2016
|
New code was committed to pull request. |
|
@bors-servo: r=jdm |
|
|
typical `requestAnimationFrame()` animations.
This skips useless message traffic when `requestAnimationFrame()` is
called during an animation frame callback. It reduces CPU usage of the
following snippet by 49%:
<script>
function foo() {
requestAnimationFrame(foo);
}
</script>
<button onclick="foo()">Start rAF</button>
Partially addresses #9844.
bors-servo
added a commit
that referenced
this pull request
May 17, 2016
…s, r=jdm
script: Avoid needless `ChangeRunningAnimationsState` messages during typical `requestAnimationFrame()` animations.
This skips useless message traffic when `requestAnimationFrame()` is
called during an animation frame callback. It reduces CPU usage of the
following snippet by 49%:
<script>
function foo() {
requestAnimationFrame(foo);
}
</script>
<button onclick="foo()">Start rAF</button>
Partially addresses #9844.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11205)
<!-- Reviewable:end -->
|
|
highfive
commented
May 17, 2016
|
|
@bors-servo: retry |
bors-servo
added a commit
that referenced
this pull request
May 17, 2016
…s, r=jdm
script: Avoid needless `ChangeRunningAnimationsState` messages during typical `requestAnimationFrame()` animations.
This skips useless message traffic when `requestAnimationFrame()` is
called during an animation frame callback. It reduces CPU usage of the
following snippet by 49%:
<script>
function foo() {
requestAnimationFrame(foo);
}
</script>
<button onclick="foo()">Start rAF</button>
Partially addresses #9844.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11205)
<!-- Reviewable:end -->
|
|
highfive
commented
May 17, 2016
|
|
@bors-servo: retry |
bors-servo
added a commit
that referenced
this pull request
May 18, 2016
…s, r=jdm
script: Avoid needless `ChangeRunningAnimationsState` messages during typical `requestAnimationFrame()` animations.
This skips useless message traffic when `requestAnimationFrame()` is
called during an animation frame callback. It reduces CPU usage of the
following snippet by 49%:
<script>
function foo() {
requestAnimationFrame(foo);
}
</script>
<button onclick="foo()">Start rAF</button>
Partially addresses #9844.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11205)
<!-- Reviewable:end -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
pcwalton commentedMay 16, 2016
•
edited by larsbergstrom
This skips useless message traffic when
requestAnimationFrame()iscalled during an animation frame callback. It reduces CPU usage of the
following snippet by 49%:
Partially addresses #9844.
This change is