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

[data grid] Input lag in GridToolbarQuickFilter on slowly typing #6783

Closed
2 tasks done
ithrforu opened this issue Nov 8, 2022 · 7 comments · Fixed by #9630
Closed
2 tasks done

[data grid] Input lag in GridToolbarQuickFilter on slowly typing #6783

ithrforu opened this issue Nov 8, 2022 · 7 comments · Fixed by #9630
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature

Comments

@ithrforu
Copy link
Contributor

ithrforu commented Nov 8, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/pedantic-field-o02961?file=/src/App.js

https://codesandbox.io/s/adoring-lewin-i471nc?file=/src/App.js

Steps:

  1. Open sandbox
  2. Try to print in GridToolbarQuickFilter (slowly as possible)

Click to gif:
quickfilter-input-lag11

Current behavior 😯

Sometimes quick filter Input "eats" the last characters (with any debounceMs).

Expected behavior 🤔

Correct printing at any speed.

Context 🔦

There was a similar problem in #5283. Maybe GridToolbarQuickFilter need same fixed as #5646.

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID 💳 (optional)

48449

@ithrforu ithrforu added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 8, 2022
@ithrforu ithrforu changed the title Input lag in GridToolbarQuickFilter on slowly typing [data grid premium] Input lag in GridToolbarQuickFilter on slowly typing Nov 8, 2022
@m4theushw m4theushw changed the title [data grid premium] Input lag in GridToolbarQuickFilter on slowly typing [data grid] Input lag in GridToolbarQuickFilter on slowly typing Nov 8, 2022
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Nov 8, 2022
@m4theushw
Copy link
Member

m4theushw commented Nov 8, 2022

I managed to reproduce the bug in the DataGrid too.

msedge_G6c63Qi4qY.mp4

@m4theushw m4theushw added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 8, 2022
@ithrforu
Copy link
Contributor Author

ithrforu commented Nov 9, 2022

@m4theushw, do you know when will it get fixed or maybe workaround for the problem?

@joserodolfofreitas joserodolfofreitas added the feature: Filtering Related to the data grid Filtering feature label Nov 14, 2022
@m4theushw
Copy link
Member

We can't provide an estimate yet. We still need to investigate what is causing this problem. It could related to the render phase taking too much time.

The workaround we can suggest is to increase the debounce with

<GridToolbarQuickFilter debounceMs={1000} />

In https://mui.com/x/react-data-grid/filtering/#parsing-values there's a demo showing how to customize the quick filter to pass this prop.

@joserodolfofreitas joserodolfofreitas moved this to 🆕 Needs refinement in MUI X Data Grid Nov 22, 2022
@ithrforu
Copy link
Contributor Author

ithrforu commented Apr 13, 2023

Is investigation continues? If not, i think issue can be closed because the workaround helped us a lot.

@cherniavskii cherniavskii moved this from 🆕 Needs refinement to 🔖 Ready in MUI X Data Grid Jul 7, 2023
@cherniavskii cherniavskii self-assigned this Jul 7, 2023
@cherniavskii cherniavskii moved this from 🔖 Ready to 🏗 In progress in MUI X Data Grid Jul 10, 2023
@cherniavskii cherniavskii moved this from 🏗 In progress to 👀 In review in MUI X Data Grid Jul 10, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 10, 2023

This issue makes the search experience really not great, thanks for raising 👍 !


Off-topic

While this issue is about "Correct printing at any speed", it feels well related to my comment in #9120 (comment) with @romgrk. We have a 500ms input debounce that feels like a massive time waste, it makes it impossible for the search to feel responsive.

Even Google Maps reacts a lot faster to search queries. I think that we could explore this instead:

  • lower the debounce to 50ms, we would save 450ms! (0ms would probably be fine too), for comparison, the description of [DataGrid] Filtering performance #9120 talks about a win of up to 300ms.
  • turn the search to be performed in chunks, to yield to the main thread every now and then
  • start the search as soon as the end of the 50ms debounce but if a new search is input before the end of the previous one, interrupt it and restart from scratch.

@romgrk
Copy link
Contributor

romgrk commented Jul 11, 2023

Linked #9157

@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 12, 2023

Great to see this bug fixed 👌

I created an issue for the above idea #9657

@cherniavskii cherniavskii moved this from 👀 In review to ✅ Done in MUI X Data Grid Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants