-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Try to optimize getClientIdsOfDescendants using createSelector memoization.
#40112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to optimize getClientIdsOfDescendants using createSelector memoization.
#40112
Conversation
|
Size Change: +1 B (0%) Total Size: 1.22 MB
ℹ️ View Unchanged
|
| descendantId, | ||
| ...getClientIdsOfDescendants( state, [ descendantId ] ) | ||
| ); | ||
| export const getClientIdsOfDescendants = createSelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been memoized anyway, I don't think that's what caused the regression though but let's see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What?
Follow-up to #40054, which appears to have had minimal effect on performance.
This PR attempts to optimize
getClientIdsOfDescendantsusing memoization.Why?
#39985 seems to have reduced performance a bit, and #40054 doesn't seem to have done much to counteract that.
How?
This PR wraps
getClientIdsOfDescendantsincreateSelector, which should help memoize the selector.getClientIdsWithDescendantswas already usingcreateSelector, so I think this makes sense.Testing Instructions
Check the "Performances Tests" in the PR checks to get an initial impression. If it looks promising, I guess try merging this and monitor the "Block Select" metric at http://codehealth.vercel.app/ over the next several commits in
trunk.