Skip to content
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

[core] Isolate selectors called without useGridSelector #3774

Merged
merged 3 commits into from Feb 1, 2022

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented Jan 29, 2022

A follow up on #3663

In #3663 we changed to isolate the selectors called with useGridSelector. In this PR I'm isolating all the remaining selectors, which include those called passing the state manually. For these, now we need to also pass the instance ID, from apiRef.current.instanceId. If not passed, there's a warning, but the grid works normally.

I also fixed the performance regression by using a Map instead of an object to cache the selectors. The instance cache is still an object because it will only be a problem if there's dozens of instances in the same page, which is a edge case.

@mui-bot
Copy link

mui-bot commented Jan 29, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 227.3 515.5 430.8 375.3 123.617
Sort 100k rows ms 376 948.6 802 755.56 198.752
Select 100k rows ms 197 254.3 227.3 227.72 20.665
Deselect 100k rows ms 109.6 286.4 176.9 183.22 62.47

Generated by 🚫 dangerJS against bcadfc8

@m4theushw m4theushw added the core Infrastructure work going on behind the scenes label Jan 29, 2022
@m4theushw m4theushw merged commit b249cbd into mui:master Feb 1, 2022
@m4theushw m4theushw deleted the isolate-selectors branch February 1, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants