Blender Git Loki

Git Commits -> Revision 46607bc

Revision 46607bc by Bastien Montagne (master)
December 20, 2019, 13:29 (GMT)
ID Management: Improve speed of code used when creating/renaming and ID.

This commit affects `id_sort_by_name()` and `check_for_dupid()` helper:
* Add a new parameter, `ID *id_sorting_hint`, to `id_sort_by_name()`,
and when non-NULL, check if we can insert `id` immediately before or
after it. This can dramatically reduce time spent in that function.
* Use loop over whole list in `check_for_dupid()` to also define the
likely ID pointer that will be neighbor with our new one.

This gives another decent speedup to all massive addition cases:

| Number and type of names of IDs | old code | new code | speed improvement |
| -------------------------------- | -------- | -------- | ----------------- |
| 40K, mixed (14k rand, 26k const) | 39s | 33s | 18% |
| 40K, fully random | 51s | 42s | 21% |
| 40K, fully constant | 40s | 34s | 18% |

Combined with the previous commits, this makes massive addition of IDs more
than twice as fast as previously.

Commit Details:

Full Hash: 46607bc09d5cd9fa3570e5ad4b01ea4ea7adaffc
Parent Commit: 4cc8201
Lines Changed: +105, -65

5 Modified Paths:

/source/blender/blenkernel/BKE_library.h (+1, -1) (Diff)
/source/blender/blenkernel/intern/blendfile.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/library.c (+99, -59) (Diff)
/source/blender/blenloader/intern/readfile.c (+3, -3) (Diff)
/source/blender/windowmanager/intern/wm_files_link.c (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021