-
Notifications
You must be signed in to change notification settings - Fork 43
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
treeWalker is walking all nodes #72
Comments
To follow up on this: I modified my generator such that it doesn't produce the child nodes for a parent that is collapsed. This seems to solve my performance problem, but it makes the built-in expanded/collapsed state management useless, and requires me to provide a new |
Hi @murrayju
The
Actually, only the However, unfortunately, for the very large trees, there still may be some delay on collapsing/expanding because the tree needs to walk through all the nodes to create (or, more importantly, re-create) the correct list of nodes to display in the virtual table. To fix that case, I would suggest considering the async approach as well. |
No, definitely on v3. I just didn't explain what I meant very well. My approach was to use I chose this as the better of two evils, since the alternative (
I'll take a look at the async option, thanks. I shied away from this at first, since my data isn't truly "async", it is all in memory already. I created this ticket mostly because I find it surprising that the library should have to walk the generator for nodes that are not visible. Perhaps you are optimizing for something else that I'm not aware of? I could look into making a fork if my use case is just different from others, but I'd like to understand why yours is designed this way first. |
The initial goal was to optimize the display of the tree. When the Whenever the For expanding/collapsing, the internal tree walk is used. As I described above, it just walks over the tree using the pointers and updates the tree node visibility state. However, in my previous explanation, I made a mistake: not all the nodes are visited during that walk but only a subtree of a node that is triggered. When the walk is over, the prepared sub-array is injected via Hope that explanation will help you. |
I'm using
3.0.0-beta.1
. It seems that my providedtreeWalker
generator is being walked to visit every node in the tree, even though most of the nodes are not visible (collapsed).Is this how it is intended to function, or am I missing something? My use case involves a tree that is very large and very deep, and computing the nodes is somewhat expensive. Users only visit a small subset of the nodes at a time, so my hope was that the treeWalker would only visit the visible nodes and save a bunch of unnecessary computation.
As it is, there is a very noticeable (few seconds) delay on expanding/collapsing nodes (because the walks the tree again).
The text was updated successfully, but these errors were encountered: