readfile: optimization for undo
authorCampbell Barton <ideasman42@gmail.com>
Tue, 7 Jun 2016 06:07:13 +0000 (16:07 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 7 Jun 2016 07:27:52 +0000 (17:27 +1000)
commit441a440cbbb700511d6d1ec01e2f149355adcc02
tree8bfe53163793c9b7ab7447d41edad7d90cc77240
parent3054e33d67c8f524dae915c8f1f016a7bfa63ab0
readfile: optimization for undo

Was using O(n^2) lookup on ID's with undo.

This caused undo to hang with 1000's of data-blocks
(especially with heavy scenes & outliner-space, which doesn't even need to be visible to cause a slow-down).

Internally this uses a ghash per id-type, which is lazy-initialized.
Each key uses the name and library since there may be name collisions between libraries.

Developer Notes:

- Adds small `BKE_main_idmap_*` API.
- Needed to change linking order for this to build.
build_files/cmake/macros.cmake
source/blender/blenkernel/BKE_library_idmap.h [new file with mode: 0644]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/library_idmap.c [new file with mode: 0644]
source/blender/blenloader/intern/readfile.c