-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Filtering performance: use Set()
when applicable
#10068
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-10068--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
Summary of this PR:
At this point, I'm not sure if I'm still interested in merging this due to the limited performance benefits that it brings. One change that I do like however is that it becomes clear what the rules are. It took me some time to figure out that tests were failing because both cc @mui/xgrid |
@@ -574,7 +575,6 @@ | |||
{ "name": "GridVisibilityOffIcon", "kind": "Variable" }, | |||
{ "name": "gridVisibleColumnDefinitionsSelector", "kind": "Variable" }, | |||
{ "name": "gridVisibleColumnFieldsSelector", "kind": "Variable" }, | |||
{ "name": "gridVisibleRowsLookupSelector", "kind": "Variable" }, |
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 feels risky TBH. While gridVisibleRowsLookupSelector
is not documented, it's exported and not marked as unstable/experimental.
Should we wait with this PR until v7 alpha?
@@ -17,7 +17,7 @@ import { | |||
createRowTree, | |||
updateRowTree, | |||
RowTreeBuilderGroupingCriterion, | |||
getVisibleRowsLookup, | |||
getHiddenRowsLookup, |
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.
However, making that change lost nearly all of the performance improvements observed in the first step.
I don't understand what caused the loss of the performance improvements.
First, you tried using Set
to keep all the visible rows.
Then, you reversed it to only keep the hidden rows. Did this increase the number of records in the Set
drastically?
Or is it something else that impacted performance?
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.
Also didn't make sense to me, but I haven't had enough time to investigate further.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Although the performance gains are interesting I don't have the bandwidth to continue exploring this one so I'll close it for now. If we look into it again, I'm pretty sure we can expose a backwards compatible interface even if we change the internal model. |
Last part of #9120
edit: Read the summary below, these results are outdated.
This PR improves performance by using
Set
where applicable.Set
56.1 (+-2.5)
Set
35.6 (+-1.8)
Test: 100,000 rows of the commodity dataset, filter one string column with the string "am". We observe gains of about 35% for this test.
Note that I was thinking we'd need to update the selectors to keep returning
objects
instead ofSets
, but I haven't found any public selector that exposes them, they're all@ignore Do not document
. If you see anything that would break semver guarantees, please point it out.