-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perf: Rely on a single store listener only
Currently when a component calls useSelect or any of a number of other hooks, the store creates a new listener through Redux's subscribe method. In this patch we're storing a custom list of listeners before calling into Redux and relying on a single Redux listener to call all of the registered functions. This reduces the number of comparisons to `getState()` when updtaing the store and measured a reduction in several key metrics by between 4% to 9%; specifically the `type`, `focus`, and `inserter` methods. Co-authored-by: Jarda Snajdr <jsnajdr@gmail.com>
- Loading branch information
Showing
2 changed files
with
36 additions
and
10 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