Files
test2/source/blender/depsgraph
Hans Goudey 37dcdb2b6a Depsgraph: Avoid quadratic overhead when building collection relations
Checking whether relations already existed was a bottleneck when building
collection -> object hierarchy relations. The duplicate checking would be
unnecessary since an object can only be in a collection once, but this function
to build relations can be called multiple times for the same collection.

To avoid the need to check for duplicates, only run the relation creation
once for each collection. The `BuilderMap` gives a simple way to do that.
Note that because a collection might be built separately as a non-layer
collection, there may still be duplicate hierarchy relations.

Building a Depsgraph for 60k simple objects became 1.86x faster, from 2.39
to 1.29 seconds.

Pull Request: https://projects.blender.org/blender/blender/pulls/137737
2025-05-02 17:51:10 +02:00
..