Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make starting animations idempotent and improve runner performance #4449

Closed
wants to merge 8 commits into from

Conversation

dweymouth
Copy link
Contributor

Description:

This PR does the following:

  • Introduces a new public API animation.State() which returns the state of an animation (not started, running, stopped). We use this internally as well
  • Makes starting animations idempotent. Starting an animation again while it is running is a no-op.
  • Improves performance of the animation runner:
    • Start is O(1) amortized
    • Stop is O(1) (down from O(n))
    • the runner is zero-alloc

Fixes #4445

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.
  • Any breaking changes have a deprecation path or have been discussed.
  • Check for binary size increases when importing new modules.

@dweymouth
Copy link
Contributor Author

Wrong base; will close and re-open a new PR

@dweymouth dweymouth closed this Dec 10, 2023
@dweymouth dweymouth deleted the animation-reduce-allocs branch December 10, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant