quakeforge/libs
Bill Currie 0360e33a00 [ecs] Add "tree mode" to hierarchies
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).
2023-07-07 14:42:49 +09:00
..
audio Nuke qboolean from orbit 2023-06-13 18:06:11 +09:00
client [console] Provide control of cursor visibility 2023-06-30 14:57:04 +09:00
console [console] Implement a very lame style editor 2023-07-06 19:39:26 +09:00
ecs [ecs] Add "tree mode" to hierarchies 2023-07-07 14:42:49 +09:00
gamecode Nuke qboolean from orbit 2023-06-13 18:06:11 +09:00
gib Nuke qboolean from orbit 2023-06-13 18:06:11 +09:00
image Nuke qboolean from orbit 2023-06-13 18:06:11 +09:00
input Nuke qboolean from orbit 2023-06-13 18:06:11 +09:00
models [model] Clean up the brush leaf api a little 2023-06-28 21:45:41 +09:00
net Nuke qboolean from orbit 2023-06-13 18:06:11 +09:00
qw [util] Make sizebuf and msg sizes unisgned 2021-04-04 15:53:53 +09:00
ruamoko [ui] Add support for simple text strings 2023-07-01 19:42:02 +09:00
scene [model] Clean up the brush leaf api a little 2023-06-28 21:45:41 +09:00
ui [ecs] Add "tree mode" to hierarchies 2023-07-07 14:42:49 +09:00
util [util] Integrate sys_mem into the build 2023-07-04 14:39:36 +09:00
video Fix a couple of windows build issues 2023-07-06 02:04:47 +09:00
Makemodule.am [ecs] Move ECS core into its own library 2022-10-26 17:24:03 +09:00