[Bf-blender-cvs] [626db356a62] temp-T94185-id-remapper-ui: Performance: Remap multiple items in UI

Jeroen Bakker noreply at git.blender.org
Mon Jan 24 12:01:42 CET 2022


Commit: 626db356a62d9c71179cb54c03b148a551ec5940
Author: Jeroen Bakker
Date:   Mon Jan 24 09:57:53 2022 +0100
Branches: temp-T94185-id-remapper-ui
https://developer.blender.org/rB626db356a62d9c71179cb54c03b148a551ec5940

Performance: Remap multiple items in UI

iDuring sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.

If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.

Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

===================================================================

M	source/blender/blenkernel/intern/lib_id_delete.c

===================================================================

diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c
index a1d6fa232ed..f4dd67cac28 100644
--- a/source/blender/blenkernel/intern/lib_id_delete.c
+++ b/source/blender/blenkernel/intern/lib_id_delete.c
@@ -326,6 +326,7 @@ static size_t id_delete(Main *bmain, const bool do_tagged_deletion)
                                           ID_REMAP_FORCE_NEVER_NULL_USAGE |
                                           ID_REMAP_FORCE_INTERNAL_RUNTIME_POINTERS));
     }
+    BKE_id_remapper_free(remapper);
   }
 
   BKE_main_unlock(bmain);



More information about the Bf-blender-cvs mailing list