[v7] Nested rows performance issues #3839
Replies: 3 comments
-
Well aware of the performance problems here, unfortunately. This issue is one that I ended up transferring to v8 due to the big architectural changes that were needed to improve it. As far as v7 goes, I'm not going to be tackling the issue there. If you'd like to try out v8 while it's still in beta, I'd love to keep working on the perf expectations there. |
Beta Was this translation helpful? Give feedback.
-
Also worth pointing out here that rerendering/painting is also a pain here. The multipliers are actually really high when you have this many columns, and even just rerendering that many components that have any amount of complexity can be a strain on react itself. While I realize this isn't all of the time spent rendering, it's worth mentioning that the ability to memoize/optimize render performance in v8 is also something that is feasible and easy now (it is not v7 😢 ) |
Beta Was this translation helpful? Give feedback.
-
@tannerlinsley, thanks for the answers. I have several questions regarding that:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Prerequisites:
useExpand
hook is used (provided with the library)When clicking on an expandable row (a top-level or a nested one), there is a noticeable delay before the status changes, even with 100 records. It becomes worse as the amount of the records grows. According to the profiling results, expanding a row (200 records) takes ~2 seconds, 600ms of which is rendering. I assume that the rest could be related to
useTable
/useExpand
hooks inner logic.Some profiling screenshots:


And every single cell is rendered.
There is also a related problem: often expanding/collapsing doesn't work when DevTools is opened (in Google Chrome), so it is difficult to profile the table's work.
Your minimal, reproducible example
https://codesandbox.io/s/react-table-performance-issue-u3ob82?file=/src/App.js
Steps to reproduce
Expected behavior
As a user, I expected a row is expanded/collapsed instantly.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
react-table version
7.7.0
TypeScript version
No response
Additional context
There are 2 files with the stubs in the sandbox -
stubs
andstubs-simplified
. In the last one I removed all 0 values fromdurationByDates
objects, hoping that it will reduce the problem a bit, but it didn't help.Terms & Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions