Reduce animation registry copying and allocation - #58766
Closed
bartlomiejbloniarz wants to merge 2 commits into
Closed
bartlomiejbloniarz wants to merge 2 commits into
bartlomiejbloniarz wants to merge 2 commits into
Conversation
Summary: For every raw update, `AnimatedPropsRegistry::update` copied the incoming props before merging them, and it built a full typed view-props snapshot even when no typed prop was animated. It now merges from the incoming `folly::dynamic` without copying it and allocates typed props only when a typed update arrives. The merge semantics (Folly's merge-patch) and the caller's input are unchanged. On a low-end Android phone (4× Cortex-A53) with 12 views animating opacity, the registry update per frame dropped from about 0.22 ms to 0.13 ms. The new registry tests are excluded from React-Fabric's CocoaPods and Swift Package Manager production sources. Changelog: [General][Performance] - Reduce animation registry copying and allocation Test Plan: - New `AnimatedPropsRegistryTest` cases pass on Android: recursive merges, null deletion, arrays, mixed raw and typed updates, JSI conversion and input preservation. - React-Fabric's CocoaPods and Swift Package Manager source lists exclude `AnimatedPropsRegistryTest.cpp` and still include `AnimatedPropsRegistry.cpp`. Not built for iOS. - C++ API snapshots regenerated.
Tests, C++ API snapshots and Apple test-source exclusions for the change in the parent commit.
bartlomiejbloniarz
added this pull request to stack #58767
September 30, 2026 13:00
|
Caution Invalid Base Branch The base branch for this PR is |
This file contains hidden or 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
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
For every raw update,
AnimatedPropsRegistry::updatecopied the incoming props before merging them, and it built a full typed view-props snapshot even when no typed prop was animated. It now merges from the incomingfolly::dynamicwithout copying it and allocates typed props only when a typed update arrives. The merge semantics (Folly's merge-patch) and the caller's input are unchanged.On a low-end Android phone (4× Cortex-A53) with 12 views animating opacity, the registry update per frame dropped from about 0.22 ms to 0.13 ms.
The new registry tests are excluded from React-Fabric's CocoaPods and Swift Package Manager production sources.
Changelog:
[General] [Performance] - Reduce animation registry copying and allocation
Test Plan:
AnimatedPropsRegistryTestcases pass on Android: recursive merges, null deletion, arrays, mixed raw and typed updates, JSI conversion and input preservation.AnimatedPropsRegistryTest.cppand still includeAnimatedPropsRegistry.cpp. Not built for iOS.