Blender Git Loki

Git Commits -> Revision 6374644

Revision 6374644 by Jacques Lucke (master)
September 29, 2020, 10:29 (GMT)
DNA: optimize struct reconstruction by doing some preprocessing

When loading large files that are more than a couple weeks old
(such that DNA has changed in that time), a significant amount of
time is spent in `DNA_struct_reconstruct`. This function takes a struct
in the old layout and creates a struct in the new layout from it.

This was slow because it was computing the diff between the struct
layouts every time a struct is updated. Now the steps for the struct
reconstruction is computed only once per struct. This information is
then used to actually reconstruct all structs that changed.

I measured about 10-20% speedup when loading Spring files.
E.g. `10.6s -> 8.7s` for `06_055_A.anim.blend` in BKE_blendfile_read`.

This percentage varies a lot based on the number of blocks that have
to be reconstructed and how much DNA has changed since they have
been written. In none of my tests was the new code slower than the
old code.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8959

Commit Details:

Full Hash: 6374644fd11797806ab2e92341e5e7d32e94067b
Parent Commit: b41fb55
Lines Changed: +678, -456

5 Modified Paths:

/source/blender/blenloader/intern/readfile.c (+8, -4) (Diff)
/source/blender/blenloader/intern/readfile.h (+1, -0) (Diff)
/source/blender/makesdna/DNA_genfile.h (+9, -3) (Diff)
/source/blender/makesdna/DNA_sdna_types.h (+2, -2) (Diff)
/source/blender/makesdna/intern/dna_genfile.c (+658, -447) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021