-
-
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
[XGrid] Performance issue when sorting/filtering 100k rows client-side #1506
Comments
@arheinjohnson Do you have a reproduction we can look into? Also, could you be more specific on what you mean by slow (for what use case/action)? |
Right, so scrolling and pagination are still great, but the sort and filter experience becomes painful. I was surprised to see this, because the Commercial version demo here is rather fast: Do you recommend against server side pagination and filtering? Here's a reproduction, but it has 1mil rows to get my point across, since there are only two columns. |
@arheinjohnson I'm confused. The reproduction is using client-side sorting and filtering but you seem to use the server-side in real-life. |
Oh my mistake for not being clear, I am using client-side and am asking how to improve performance. For example, would you recommend server-side if I have data sets > 100k rows? Or am I missing something else obvious about XGrid to make it perform faster? |
I have updated the reproduction to log the time a sort and filter would normally take: https://codesandbox.io/s/great-rain-uy0be?file=/src/Demo.tsx. You are right, it should be really fast: https://codesandbox.io/s/great-rain-uy0be?file=/src/Demo.tsx. I can confirm that there is something significantly wrong. Sorting 100k rows in the live demo should take at most 200ms not ~2,000ms. |
What do you recommend we do in the short term, or will a resolution be available sooner than later? |
@dtassone was planning to work on performance issues this sprint. |
I have removed the heavy work of the params that we send in events. |
Sorry if this is obvious, do we need to upgrade XGrid to pull the performance improvements? |
@arheinjohnson check the CI status of #1513, you should find a codesandbox step. Open it. Then, you should find a version of the component you can install with the WIP changes. |
I believe there is clear perf improvement |
Thanks for this! Weird, when I went to sort "Commodity" ASC, I received an unresponsive page error. Due to firewall, I'm unable to upload a screenshot. |
So, how much faster should server-side filtering and server-side pagination be for XGrid? Wondering if you can help me understand the trade-offs for server-side versus client-side. |
@arheinjohnson It would depend. Cost of client-side filtering:
Cost of server-side filtering:
|
That helps, thanks @oliviertassinari. We'll try out server-side filtering and server-side pagination to see if we get our desired performance. Some of the database queries can be cut out with caching. Is there any hope for very fast client-side loading and filtering in the future for > 100k records? |
For 100k records, I don't see why it would take more than 1ms, 10ms top, client-side, with proper caching. |
Feels like I'm going in a circle a bit, sorry for that. Well we upgraded from 4.0.0-alpha.24 up to 4.0.0-alpha.27 and it seems to have alleviated our XGrid performance problems for 100k rows for now. Sorting and filtering client-side are pretty fast. Will let you know as we learn more! Thank you for the component! |
@arheinjohnson Actually, I'm curious. How did you manage to load 100k records client-side? I had always assumed that this wasn't really possible in production, that 100k row cases would be server-side unless or when running inside an electron environment with direct fs access. Stay posted, we will close this issue once we are happy with the result. We will share progress along the way. |
I am not sure what you are asking, I'm using a standard http request to retrieve rows from an API. By the way I am using client-side pagination, not loading 100k rows into a single page. |
To load large amount of data on the client side, you should batch server updates with a stream, and update the grid using Also performance will improve when we merge #1513 |
I want to jump in to point out that there is major performance issue with filtering since 4.0.0-alpha.23. You can see it here https://material-ui.com/components/data-grid/#commercial-version with filter "commodity contains 'soy'". That is taking more than 1m to filter. If you open up the code sandbox for this example (https://codesandbox.io/s/cgbej), and switch to 4.0.0-alpha.22, you'll see that filter performs in milliseconds speed rather than minutes. It doesn't look to me like #1513 addresses this, but I could be wrong. edit: |
@dtassone Should we close this issue? It seems that we have fixed the main pain point (slow filtering). |
Current Behavior 😯
When we use XGrid for 100k rows, performance is very slow and usually crashes the browser. For 50k rows, performance is still unacceptably slow. How can we improve the performance? What are the trade offs of server side filtering and server side paginating?
Expected Behavior 🤔
Faster UX.
Steps to Reproduce 🕹
https://codesandbox.io/s/awesome-framework-kqbcp?file=/src/Demo.tsx
Your Environment 🌎
`npx @material-ui/envinfo`
Order id 💳
Order #23360
The text was updated successfully, but these errors were encountered: