forked from facebook/react-native
-
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.
Calculate Android mounting instructions based on updates accumulated …
…in rawProps (facebook#48303) Summary: ## Context If a component is re-rendered/committed multiple times before mount, Android mounting layer creates and executes mounting instructions for every commit. Component's native representation is updated multiple times, potentially triggering expensive computations (e.g. recreating boxShadows) for a single draw. A more efficient way would be to create mounting instructions to update the component from the initial state (before the first render) to the final state (after the last render) in one go. iOS does that. This diff is an attempt to experiment on achieving such behaviour for Android. ## Implementation Details 1. When cloning a ShadowNode, accumulate all the updates in `Props.rawProps`. 2. For calculating prop update payloads to be sent to the Android mounting layer, diff old and new `rawProps` by calling `newProps->getDiffProps(oldProps)`. 3. Most importantly, move computing of the mounting instructions from `schedulerDidFinishTransaction`, which is called after every commit, to `schedulerShouldRenderTransactions` which happens only once, after the final commit. Changelog: [Internal] Reviewed By: javache Differential Revision: D63457028
- Loading branch information
1 parent
03b9f04
commit a444ece
Showing
26 changed files
with
397 additions
and
119 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
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
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
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
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
Oops, something went wrong.