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

Animated: Store Listeners w/ Map #46372

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Sep 6, 2024

  1. Animated: Refactor NativeAnimatedHelper (facebook#46312)

    Summary:
    Pull Request resolved: facebook#46312
    
    Refactors `NativeAnimatedHelper` to make it easier to read, reduce runtime overhead, and no longer export `queueOperation` (which was not useable externally anyway).
    
    Changelog:
    [Internal]
    
    Reviewed By: javache
    
    Differential Revision: D62139993
    yungsters authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    6e58fcd View commit details
    Browse the repository at this point in the history
  2. Animated: Optimize Traversals in Nodes (facebook#46286)

    Summary:
    Pull Request resolved: facebook#46286
    
    Optimizes the runtime performance of `Animated` by using memoization to avoid repetitive traversals of `props` (and `style`) values.
    
    Changelog:
    [General][Changed] - Improved runtime performance of `Animated`
    
    Reviewed By: javache
    
    Differential Revision: D62037506
    yungsters authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    72fa38e View commit details
    Browse the repository at this point in the history
  3. Animated: Store Listeners w/ Map

    Summary:
    Currently, `AnimatedNode.prototype.getListeners` creates an array with `Object.keys()` to determine the number of listeners.
    
    This is a relatively hot code path for animation-intensive user interfaces. Although `Object.keys()` is fast, every unnecessary memory allocation is an unnecessary opportunity to create garbage that requires collection.
    
    Using an object as a dictionary performs worst than using a `Map` anyway, so this switches `AnimatedNode` to use a `Map`.
    
    Changelog:
    [Internal]
    
    Reviewed By: javache
    
    Differential Revision: D62267352
    yungsters authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    043b0ae View commit details
    Browse the repository at this point in the history