-
-
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
[data grid] Improve quick filter performance (INP) #9657
Comments
Linked #9157 |
A quick performance benchmark to illustrate the problem. In both cases 100,000 rows, and using the quick filter search AG Gridhttps://www.ag-grid.com/example/ From the last key down to the first frame, we wait 277ms. It feels like they don't have any debounce at all, but it's doesn't feel great, the input update is lagging, ewww 🙈 MUI Xhttps://mui.com/x/react-data-grid/#commercial-version, using a modified version of the demo to add slots={{ toolbar: GridToolbar }}
slotProps={{
toolbar: {
showQuickFilter: true,
},
}} From the last key down to the first frame, we wait 1,430ms. With the work on #9120 and related to it, I imagine we could move from 894ms spent on JS, down to 194ms (for those not doing the filter server-side), we would then get the wait from 1430ms to 730ms. By reducing the debounce, we could save another 450ms, going down to 280ms. At that point, it will be great, making you want to actually explore the data 👌😍 |
What if replace debounce with |
@ithrforu |
I'm reopening. We had a step forward in #9712, but:
|
|
@romgrk Two demos: see how "q" takes a long time to be updated in the Screen.Recording.2023-08-29.at.01.14.58.movand see how select all + delete doesn't work: Screen.Recording.2023-08-29.at.01.13.57.mov |
Yes so it feels like all of those issues are caused by the filter being triggered in-between the keypresses. The immediate solution to that would be to... increase the filter debounce again 😅 With the 150ms delay, the UX for grids with small datasets is better, but for large datasets it's worst. I have mentioned somewhere else that an adaptive debouce delay could be interesting (small dataset = small delay, large dataset = large delay). And of course the ideal solution would be interruptable filtering, but that requires quite a bit of work and it's not on the roadmap at the moment afaik. We may want to discuss how to prioritize that. |
Is it the same issue we saw earlier in #9712 (comment)? |
It doesn't feel like the same issue, it's not a logical bug, it's caused by the CPU doing filtering while the user is typing. |
I'm coming here from https://twitter.com/addyosmani/status/1767540608779083972, INP is now part of SEO ranking. Testing https://next.mui.com/x/react-data-grid/filtering/quick-filter/ using https://web.dev/articles/debug-cwvs-with-web-vitals-extension (Chrome extension) illustrates the problems well: Screen.Recording.2024-03-13.at.00.06.20.movThis video is perfect https://youtu.be/KZ1kxzsJZ5g?si=DmhtZ8DZ0rbxs35-&t=223 and bring back the solution raised before. We need to make two changes/two PRs:
|
One day, we could use
that has a "background" task priority inherited from requestIdleCallback() but we want "user-visible", no? https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API#task_priorities |
Summary 💡
We have a 500ms input debounce that feels like the biggest chunk of time where end-users are waiting for the data grid to return results. I believe that even with an instant filtering, this denounce makes it impossible for the search input to feel delightful.
mui-x/packages/grid/x-data-grid/src/components/toolbar/GridToolbarQuickFilter.tsx
Line 74 in df534be
mui-x/packages/grid/x-data-grid/src/components/panel/filterPanel/GridFilterInputValue.tsx
Line 8 in 82ab9c0
I suspect that we could fix it like this:
Examples 🌈
https://mui.com/x/react-data-grid/filtering/quick-filter/
Motivation 🔦
No response
Order ID 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: