Closed Reinmar closed 10 months ago
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).
π Provide a description of the improvement
I've been doing some research and found out that using a TreeWalker is 50-100x slower than using a simple recursive loop.
In the previous iteration I noticed performance boosts when optimizing the model TreeWalker or position API used by it.
TreeWaker is quite heavy due to the number of checks that it performs or created position instances. Yet, from my experience, in a number of cases we need it to scan content of particular elements.
It'd be interesting to research what kind of (model and view) tree walker instances are created in terms of:
Based on this we could figure out whether we couldn't introduce and use some quick iteration methods for simpler cases:
element.getDescendants()
element.getDescendants( { from: descendantNode, to: 'end' } )
If you'd like to see this improvement implemented, add a π reaction to this post.