mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
0360e33a00
As I had long suspected, building large hierarchies is fiendishly expensive (at least O(N^2)). However, this is because the hierarchies are structured such that adding high-level nodes results in a lot of copying due to the flattened (breadth-first) layout (which does make for excellent breadth-first performance when working with a hierarchy). Using tree mode allows adding new nodes to be O(1) (I guess O(N) for the size of the sub-tree being added, but that's not supported yet) and costs only an additional 8 bytes per node. Switching from flat mode to tree mode is very cheap as only the additional tree-related indices need to be fixed up (they're almost entirely ignored in flat mode). Switching from tree to flat mode is a little more expensive as the entire tree needs to be copied, but it seems to be an O(N) (size of the tree). With this, building the style editor window went from about 25% to about 5% (and most of that is realloc!), with a 1.3% cost for switching from tree mode to flat mode. There's still a lot of work to do (supporting removal and tree inserts). |
||
---|---|---|
.. | ||
Makemodule.am | ||
test-components.c | ||
test-compops.c | ||
test-hierarchy.c | ||
test-registry.c | ||
test-subpools.c | ||
test-treehierarchy.c |