-
-
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: compile filter applier with eval #9635
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-9635--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
packages/grid/x-data-grid/src/hooks/features/filter/gridFilterUtils.ts
Outdated
Show resolved
Hide resolved
@@ -234,20 +236,60 @@ export const buildAggregatedFilterItemsApplier = ( | |||
return null; | |||
} | |||
|
|||
return (row, shouldApplyFilter) => { |
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.
Can you share a benchmark compared to the master
branch?
Curious to learn what is the benefit in this PR on its own 🙂
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.
Filtering 100,000 rows on my device:
Case | Result |
---|---|
Without | 70.2 +- 3.8 |
With | 62.6 +- 4.7 |
The improvement is consistenly around 11% for a realistic number of rows, but with a small improvement as N grows.
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.
Great, thanks!
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.
Thanks for the benchmarks, seems to improve the filtering performance further. 🎉 I think we can go ahead with it and see how it works.
I couldn't see any major risks or downsides of using eval other than code being slightly less manageable (for modifying, one may have to copy paste the commented version, change it and convert to the the stringified one again)
This PR applies point 5 of #9120.