-
Notifications
You must be signed in to change notification settings - Fork 291
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
Reduce the cell dom layer #396
Comments
These come from FixedDataTable.Cell. There's no requirement to use the default cell so you should feel free to pass in your own React component in it's place. Another tip, make sure your cells are all PureComponents and don't re-render while scrolling. By and large most performance issues with the grid are a result of using cells which don't check their props to prevent extra rendering. |
Thanks @wcjordan , another question: if use my own cell component, can I still use
option to allow my cell component to be recycled and get the performance benefits? |
Yep. That's implemented in the row rendering. |
Thanks @wcjordan , I've tried this solution, it works, reduces a lot dom layers, and the cell recycling is work just fine, It feels a little bit better, but i'm not sure, cuz scrolling is still a little bit delay, I wander is there any delay time you've added in when scroll events occured? is that because I use trackpad when scrolling? |
Nope |
Hey @wcjordan , we are still experiencing some laggy scrolling, we avoid the unnecessary dom layers, we avoid duplicated cell rendering , but still feels scrolling is slower, couldn't catch up with the hand moving speed, compare to react-virtualized MultiGrid, and I've checked the source code, I guess the reason the scrolling is still laggy is because you have to control scrolling stuff from outside and make the row scrolling by spend a react render lifecycle, I'm not sure, Do you think so? |
Feel free to fork the repo and try out those ideas. I'm suspicious that it will help. When I've seen issues like what you describe it has nearly always been the case that the cells are re-rendering causing performance issues. I'd recommend ensuring your cells are pure components and don't re-render on scroll before pursuing anything else. |
I've 1, 3, 4, on my forked version, it works well, it did help to improve the performance. Because when you have large table that has many narrow(small columnWidth) columns and display on a large wide screen , it will produce lots of dom nodes, when you scroll to update the dom position, lots of dom nodes will be handled by outside scrolling event, that means the more layer you have ,the more calculation and update you need to update the position. so I think reduce the dom nodes could really help to improve the performance. I've tried my version, I guess it helps, but I haven't got the stats yet. You could checkout the commit that I pushed to my forked version, give me some suggestions or tips would be a very good help, thanks |
That's great. @pradeepnschrodinger could you check out the fork and see if there's anything we could bring in to the v1 branch? Kevin, one note FDT isn't well designed for handling lots of columns since it doesn't virtualize them. Once you get to 100s of columns you'll see performance issues. There's a proof-of-concept to virtualize columns at #153 but it has some bugs / unfinished work. |
And... the 2nd idea is DONE by just display the single solo directly without cellGroup layer wrapping. works just fine, here I am to reduce another DOM nodes layer, Yay!. @wcjordan I see your point, but I don't think there is a need to virtualize the column , because column is just a concept DOM, or should I say, it's just a HOC or virtualize DOM, there is no real column DOM in the dom tree, all you render is cell, and since the cell is already virtualized, I guess column virtualization is not needed anymore. |
@wcjordan Yea, will take a look at the fork soon. |
Hey, sorry for the extremely late response. @KevinYaoooooo I like your suggestions and I think it would be a nice addition to the v1.0-beta branch! Although I haven't really tested around your fork and checked the performance, but have taken a good look through the codebase. I also saw a few other changes (something around It would be extremely helpful if you can put a PR for each of the suggestions outlined above. It would be easy since you already have these on your fork. You could also put the parts around noRowRenderer if you want. |
And yeah, suggestion 2 seems to be easy and yet another nice addition. @KevinYaoooooo @wcjordan So I would suggest doing most of these for the v1.0-beta branch. Thoughts? |
@KevinYaoooooo, sorry, don't think I really understood, but currently, only the rows are virtualized. |
@pradeepnschrodinger I think you had a branch to work on this. Should we re-open this ticket or open a clean one to track that work? |
@wcjordan, I don't have a branch on this.
@KevinYaoooooo, can you open a PR for this? Also, If it's not too much trouble, could you separate out PRs for each of the issue? The target can be master/v1.0-beta. Thanks. |
Expected Behavior
scroll behavior could be more faster
Current Behavior
scroll behavior have been more laggy if there are more columns and rows, I have used those two options:
but it still laggy.
I guess, since there are too many layers on cell component like below screenshot:
Possible Solution
reduce the layer that is unnecessary for the layout and behavior
Steps to Reproduce (for bugs)
produce lots of rows(20+), lots of columns(20+)
Context
it's table to show project list and the attributes of each project on each column.
Your Environment
The text was updated successfully, but these errors were encountered: