Page MenuHome

Remap multiple items in referenced data.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Feb 8 2022, 9:28 AM.

Details

Summary

This patch increases the performance when remapping data.
D13615: Performance: Remap multiple items in UI introduced a mechanism to remap multiple items in a single go.
This patch uses the same mechanism when remapping data inside ID datablocks.

Benchmark results when loading the village scene of sprite fright on AMD Ryzen 7 3800X 8-Core Processor

Before this patch 115 seconds

When patch applied less than 43 seconds

There is still some room for improvement by porting relink code.

Diff Detail

Repository
rB Blender
Branch
tmp-T95279-remapping-type (branched from master)
Build Status
Buildable 20438
Build 20438: arc lint + arc unit

Event Timeline

  • Reuse id_remapper during cleaning.
  • Add BKE_library_id_can_use_filter_id.
  • Debug functions for id_remapper.
  • Moved id_remapper one level down.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Feb 9 2022, 2:06 PM
  • Moved id_mappings one level.
  • Use ID runtime to tag ids.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Feb 9 2022, 3:50 PM
source/blender/blenkernel/intern/lib_remap.c
71

Remove obsolete comment.

source/blender/makesdna/DNA_ID.h
487

Revert format changes

  • Fix test case unassign_when_mapped_to_self.
  • Fix test case users_are_decreased_when_not_skipping_never_null.
  • Revert formatting changes in DNA_ID.h.
  • Cleanup: Remove obsolete comment.
Jeroen Bakker (jbakker) added inline comments.
source/blender/blenkernel/intern/lib_id_remapper.cc
195

Remove comment. Assert statement has this in the message

221

Debug helpers could land in master outside this patch.

Jeroen Bakker (jbakker) requested review of this revision.Feb 10 2022, 11:06 AM
  • Rebased with latest master.
  • Missing runtime member in ID struct
  • Remove redundant comment.
  • Remove redundant import.
  • Revert code formatting style.
source/blender/blenkernel/BKE_lib_query.h
21

Remove is redudant import.

source/blender/blenkernel/intern/lib_remap.c
341–342

revert formatting change

Bastien Montagne (mont29) requested changes to this revision.Feb 11 2022, 11:46 AM

LGTM, mostly minor improvements suggested below.

source/blender/blenkernel/BKE_lib_remap.h
184–187

Would be good to have detailed explanation of the meaning of those three options?

source/blender/makesdna/DNA_ID.h
351–359

Think this should be in its own sub-struct inside ID_Runtime (ID_Runtime_Remap?).

This runtime will be used for many other things, better keep it well organized from the start.

352

can be renamed to just status once put into a remap sub-struct.

This revision now requires changes to proceed.Feb 11 2022, 11:46 AM
Jeroen Bakker (jbakker) marked 3 inline comments as done.
  • Describe ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF option.
  • Moved remap status and counters in own runtime struct.

LGTM

source/blender/blenkernel/BKE_lib_remap.h
189

instead ;)

This revision is now accepted and ready to land.Feb 11 2022, 2:40 PM

Rebased with latest master.

This revision was automatically updated to reflect the committed changes.