question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[useResizeColumns] User action lags with increase in row and columns

See original GitHub issue

When grid has good amount of cells displayed then on column resize - both user action and column re-sizing functionality starts lagging.

Can be reproduced at - https://codesandbox.io/s/resize-columns-lagging-9puen In above example this occurs with 70 rows with ~30 columns, but real world applications will have more render costly cell, then this lag would be easily observed by lib users with less data also.

Is there anything we can do to improve this performance(assuming that cell renderer is fully optimized) ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
ViieeScommented, Jan 29, 2021

@tannerlinsley

I just tested in prod. The reconciliation phase is much much faster, but rendering to v-dom phase is still slow, simply due to the amount of cells. The biggest offender here is prepareRow, then after that just the actual renderer. A few ideas from here:

  • virtualizing the columns and rows would really speed things up without hurting a lot
  • memoizing the actual output of these cells would also speed things up, but also would start to restrict the update-ability of the cells in the future.

How about to not affect cells size until mouse button up? Just need to draw a vertical line and move it like in old Windows.

6reactions
xSynackcommented, Aug 12, 2021

I fixed this by adding react. memo to my table body. Then I passed a custom function to react. memo that would check if any column is resizing and not rerender my row cells until isResizing is false. Iv only tested with 1000 rows in development and performance now is 10/10 when resizing. Hope this helps anyone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[useResizeColumns] User action lags with increase in row ...
When grid has good amount of cells displayed then on column resize - both user action and column re-sizing functionality starts lagging.
Read more >
React-Table: useResizeColumns, useBlockLayout
Exploring column resizing. Understand the useBlockLayout hook. Being able to set explicit widths for columns.
Read more >
Excel lag when resizing columns - Microsoft Community
Hi! Excel becomes extremely sluggish when I try to resize a column even on a blank excel document. Tried uninstalling and reinstalling, ...
Read more >
How to resize columns with React Table Hooks with a specific ...
You need to set the max width for the table. You can use this code. const defaultColumn = React.useMemo( () => ({ width:...
Read more >
Lag Column – KNIME Community Hub
The lag option L in this node is useful for time series prediction. If the rows are sorted in time increasing order, to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found