Skip to content
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

Inspector tree is traversed more times than necessary #7980

Closed
elliette opened this issue Jun 25, 2024 · 0 comments
Closed

Inspector tree is traversed more times than necessary #7980

elliette opened this issue Jun 25, 2024 · 0 comments
Assignees

Comments

@elliette
Copy link
Member

There are two methods that traverse the inspector tree:

  • childrenCount - this method traverses the tree once to count all the nodes
  • getRowIndex - this method traverses the tree until it reaches the given node. When the tree is initially built, this method is called on every single node 😬 (although the results are cached)

Ideally these two methods could be combined, so that we don't have to modify our tree traversal logic in two places. Furthermore, on initial load of the tree we should build all rows in a single traversal of the tree, instead of traversing it n times.

Further optimizations:

  • When a node is marked as dirty (e.g., it has been expanded or collapsed), we should rebuild only the rows in that node's branch instead of the entire tree. Because currently multiple nodes are marked as dirty for a single update, we will need to be careful to not rebuild more times than necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants