- Joined
- Dec 13, 2022
If I want a performant tree implementation, assuming binary tree, i'd just use a linear array. If its a tree with arbitrary many nodes, i'd still use a linear array but store the links to the child nodes as index and count, with some padding, between the various lists of child nodes to allow for growth if necessary (and move the nchild odes within that array if it outgrows the space available for it). Though, i guess this could end up necessitating resguffling the lists of childnodes at some point if they grow to be too much like random accesses.Instead of writing a tree in some abstract language why not work with the machine as it is?
If it was practical (it's almost certainly possible) to automagically go from arbitrary semantics to machine-optimal code sure fine do it. But ECS is right there.
Source: I barely know anything about proper optimization, so please correct me if I stated anything wrong