-
-
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] performance regression on resizing on v7 #16372
Comments
Some resizing related performance issues should be better after #15648 But v7 switched from Related change: 2ac14fd @romgrk, do you remember what the rationale was for switching from Dynamic debouncing could be a good middle ground (debounce always if sizing down, as it's ok to render more content during resize), logic on sizing up should depend on whether we need to mount more columns/rows to fill the viewport. |
@lauri865 yeah you're spot on with the root cause. Changing the use of
restores the v6 feel and performance. throttle.mp4debounce.mp4From my naive user perspective, I would love to be able to restore this behaviour, like with some new |
Added some further optimisations in #15648. We're seeing buttery smooth animations in Chrome at least, even when we disable throttling completely. Curious to know how it works for you, you can use this package src: https://pkg.csb.dev/mui/mui-x/commit/b600821a/@mui/x-data-grid |
I don't remember the reason :| That PR will land on v8, I'm not sure if it's cherry-pickable on v7 but we could try, otherwise we could at least restore the old behavior. |
@lauri865 that PR really is something. I can confirm the resizing performance is a lot better with it. Unfortunately I can't easily test it on my main app, as the v8 base is causing some issues with some internal packages we have that have data-grid as a peerdep. However from testing it on a toy grid, the difference is night and day. While the performance still takes a hit if I I start resizing back and forth nonstop, that doesn't concern me, it seems that for a "reasonable" use case it should more than suffice. If the PR can be backported to v7, I'm more than happy waiting for it and fully trying it out. On a different note, it's amazing to see the PR also fixes the constant rerenders on DataGridPro and children when scrolling (and I presume other interactions), and from what you say in the comments, the styles recomputations. We had also seen some noticeable impact on scroll performance after migrating on some of our grids, and I was currently trying to track down the cause and open another issue. But it seems this PR may well also take care of that! Thank you so much, really amazing work!! |
Will track this and reopen for the cherry pick (if possible)! |
Amazing work. A cherry pick to v7 would be extremely appreciated! |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @alvarosevilla95 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Hi! Just wanted to close the loop on this one. I just bumped our x-data-grids to 7.26.0 and the change is massive! Performance is night and day compared to before. Thank you again, @lauri865, incredible work with that PR!!! 🎉 🚀 🙏 |
Steps to reproduce
Steps:
Current behavior
When resizing a data grid on v7, the grid rerenders at every step, tanking performance
Expected behavior
Resize rerenders are debounced to avoid lag. This is the behaviour on v6.
Context
Hi. Our team just migrated x-data-grid-pro from v6 -> v7. We have noticed an important performance regression when resizing a datagrid. This is particularly noticeable in a component we use in a resizable sidebar, which has completely tanked in performance.
The problem seems to be that when resizing, v7 triggers constant rerenders on the datagrid, while v6 uses some sort of debouncing that only fires when the reisizing has stabilized.
I've cloned and run the repo on v6.20.3 and v7.24.1, and can reproduce the issue on the plain repo, as well as the sandboxes above.
Here's a datagrid on the docs running on v6 with react-scan enabled:
mui-6.mp4
And the same grid on v7:
mui-7.mp4
As you can see, v6 (mostly) only rerenders at the end of the resize, when it detects the dimensions are stable, but v7 triggers many more rerenders, tanking fps.
I have not been able to find any documentation for this regression, or possible mitigations for it on the docs or the migration guide, so I'm not sure if this is a known issue, or maybe I'm missing something?
I know v7 provides the
resizeThrottleMs
prop. Increasing this does improve performance a bit, but the result looks a lot more janky than it did on v6. And even setting it to a high value like 500ms, performance seems a lot poorer that on v6.Your environment
npx @mui/envinfo
Search keywords: resize dimensions performance rerender
Order ID: 50436
The text was updated successfully, but these errors were encountered: