forked from facebookexperimental/Recoil
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix selectorGetter performance issue (facebookexperimental#1515)
Summary: The current algorithm for updating selector dependencies in the data flow graph is expensive. Currently we update the graph every time a new dependency is added, which scales very poorly. This optimization only updates the graph with all sycnhronous dependencies after the synchronous selector evaluation completes. We still have to update the graph after every asynchronous dependency is added since we need to know if we have to re-evaluate the selector if one of them is updated before the selector completely resolves. This optimization significantly helps the common case for synchronous dependencies: ``` Improvement Number of synchronous dependencies 2x 100 4x 1,000 40x 10,000 ``` facebookexperimental#914 Please refer this issue for detail Pull Request resolved: facebookexperimental#1515 Test Plan: Unit tests from D34100807 check for proper re-evaluation of updated async dependencies before async selectors resolve. Differential Revision: https://www.internalfb.com/diff/D33825247?entry_point=27 Pulled By: drarmstr fbshipit-source-id: 6df53e7bca2a2284c350149c662d7a7e7e31ca52
- Loading branch information
1 parent
b045c4f
commit 6e0f0f8
Showing
4 changed files
with
111 additions
and
15 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