-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Flattening of very large data is slow #4
Comments
The "flatten" and "rowRenderer" functions, especially the "rowRenderer", would use the most CPU time while trying to load a large tree: https://github.com/cheton/infinite-tree/blob/master/src/infinite-tree.js#L686 // Flatten nodes
this.nodes = flatten(data, { openAllNodes: this.options.autoOpen });
// Update rows
this.rows = this.nodes.map(node => this.options.rowRenderer(node, this.options)); One solution is to render only visible rows, it should be able to significantly reduce the rendering time from 10s to <0.1s. Another workaround is to use lazy loading, you can load first batch of top-level nodes (e.g. 1000 top-level nodes in one batch) at the first time, when you scroll to the bottom, then call |
I guess if already flattened list is provided to |
+1 We are working a similar idea. At the moment we are adding With the We now want to investigate if it would be possible to skip the step where the flatten data is created. I already know it is possible to create an empty |
This library is very wonderful.
it seems that flattening of 100,000 nodes takes time. Correct me if I'm wrong.
One approach can be taken where flattening should be done in chunks and that operation should return promise.
The text was updated successfully, but these errors were encountered: