Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-09-29 13:29:01 +0300
committerJacques Lucke <jacques@blender.org>2020-09-29 13:29:01 +0300
commit6374644fd11797806ab2e92341e5e7d32e94067b (patch)
tree5126cb4de4e7ffd23632b57793751e15f1b89e32 /source/blender/blenloader/intern/readfile.h
parentb41fb5542a72d8277342fead39bc0249e7306fb1 (diff)
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
Diffstat (limited to 'source/blender/blenloader/intern/readfile.h')
-rw-r--r--source/blender/blenloader/intern/readfile.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index d43f7ded50e..2ddf96a2d47 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -106,6 +106,7 @@ typedef struct FileData {
const struct SDNA *memsdna;
/** Array of #eSDNA_StructCompare. */
const char *compflags;
+ struct DNA_ReconstructInfo *reconstruct_info;
int fileversion;
/** Used to retrieve ID names from (bhead+1). */