diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-12 12:20:10 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-12 13:37:10 +0300 |
commit | afd2e9ebc38a6182746707c6c6ba65ad7414d377 (patch) | |
tree | 3707a52ecb24995c9e7bd3cbb6a23c18c512ea21 /source/blender/gpencil_modifiers | |
parent | 7f44dc79a60eddf2f81a513ca4581fc2658dc9e8 (diff) |
Fix (unreported) infinite tie building Outliner liboverride hierarchy tree.
In complex scenes featuring thousands of connections between IDs in
their liboverride hierarchies (e.g. Heist files), the time required to
check if tree items were available (before allocated a new one) would
become insanely long (O(n^2)).
This commit brings it back to roughly a constant time, only re-checking
the whole array for unused items once in a while (once every 10k times
currently), since in almost all cases is the index after `lastused`
value is not unused, and you have reached the end of the currently used
array of items, you actually need to 'allocate' a new one anyway.
It also improves the handling of `lastused` index, in particular in
`tse_group_add_element`.
This makes switching to the Outliner override hierarchy view in Heist
scenes from virtually infinite time (more than 30mins for sure) to about
20 seconds on my machine. Still far from being effectively usable.
Note that this is only a bandaid fix anyway, root of the issue is that
this view has to deal with way too many items in its tree, current code
is not designed for that. Either outliner has to improve its tree
handling (by only building subsets of the whole tree maybe?), or we have
to cull/filter out some of the ID relationships between overridden IDs
to make this view actually usable. Maybe limit the depth of the tree?
Diffstat (limited to 'source/blender/gpencil_modifiers')
0 files changed, 0 insertions, 0 deletions