forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate passive phase to depth first traversal
Because the passive phase happens after paint, I expect it's least likely to cause a performance regression. In terms of implementation complexity, however, it's probably the riskiest. Ideally, for this initial step, we would change nothing except the traversal logic. However, the old implementation is pretty weird; it doesn't really use the effect list in the normal way that the other phases do. Instead, it pushes effects into a pair global arrays (one for mount effects, one for unmount effects) during the layout phase. For those reasons, I think it makes sense to split this phase out into its own step. There's also potential for upside since we're removing code from the layout phase. The other phases are hard to justify migrating one at a time because the overhead of doing a depth-first search while also keeping track of an effect list is larger than if we just migrate them all at once.
- Loading branch information
Showing
6 changed files
with
371 additions
and
190 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
Oops, something went wrong.