forked from software-mansion/react-native-reanimated
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize hot code-paths in uAS (software-mansion#3980)
## Summary This is another attempt at optimizing useAnimatedStyle and style updater after software-mansion#3950 got reverted. In this approach we omit Object.assign completely in favor of just using newValues object. Since newValues may contain animation objects, we use one of the initial loops from the updater to extract non-animated-props such that they can be used later on instead of using a call to `filerAnimatedProps`. We also replace `styleDiff` that'd allocate new object by `shallowEqual` that only does comparison. We've been using newValues to update the values anyways and so the diff wasn't used. In addition there was a bug before where we had `if (diff)` check – this wasn't correct as in case there were no changes between the objects, the diff would be an empty object and the check would pass. ## Test plan Tested on a bunch of different examples. Make sure to verify on examples that use animations inside uAS.
- Loading branch information
Showing
2 changed files
with
26 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters