T
TanStack•2y ago
other-emerald

Significant scrolling performance hit from scrollLeft?

This is a re-post of https://github.com/TanStack/virtual/discussions/667. Perhaps Discord is more active 🙂 I am building a data grid with the tanstack react-table + react-virtual combo but I am having troubling making the scrolling performance better. When profiling with chrome dev tools, I found for every scroll event, there is half time spent on Recalculate Style and Layout, the stack trace points to get scrollLeft from the observeElementOffset of react-virtual. My grid use both vertical (row) and horizontal (column) virtualization, so 2 virtualizers with one of them as horizontal: true. Any pointer to potential improvement is much appreciated! Thanks!
No description
No description
3 Replies
wise-white
wise-white•2y ago
Hi, the scroll performance depends on a number of factors. Is your grid cells have a fix size?
other-emerald
other-emeraldOP•2y ago
@piecyk Yes, the cells are fixed size.
extended-salmon
extended-salmon•10mo ago
Any progress on this? For me I ahve just a list and scrolling on the list is fine, but if I programatically scroll via the functions on the virtualizer the scroll is really slow

Did you find this page helpful?