-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Traversal is currently exclusively recursive.
This hasn't been a performance bottleneck so far, but given how large trees can become, it is worth profiling for large trees, especially given how deep a stack of recursive calls can go (VPalm is a prime example), to see whether anything can be gained from a non-recursive traversal.
Testing different struct data layouts might also be required to get a gain, taking into account also that a multi-scale implementation with varying attribute types might not be as straightforward depending on what operation one wishes to apply to the tree.
In any case, to illustrate, wikipedia has an example implementation of depth-first search for trees (or more general graphs) : https://en.wikipedia.org/wiki/Depth-first_search