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:
authorCampbell Barton <ideasman42@gmail.com>2017-08-11 10:51:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-11 11:11:25 +0300
commit91d882a8c9e43d1b274718ee827e6f14d960ab47 (patch)
treea1873cff411a402356f821a7da2305f77e06d4b0 /source/blender/makesrna/intern/rna_internal_types.h
parent0398ee10a1b727c63b344db3d6c8d78f6bbfd633 (diff)
RNA: Use hash lookups for structs
Adding structs was checking for duplicates causing approx 75k string comparisons on startup. While overall speedup is minimal, Python access to `bpy.types` will now use a hash lookup instead of a full linked list search. See D2774
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index df591659fdb..b52f6c78f3a 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -413,6 +413,9 @@ struct StructRNA {
struct BlenderRNA {
ListBase structs;
+ struct GHash *structs_map;
+ /* Needed because types with an empty identifier aren't included in 'structs_map'. */
+ unsigned int structs_len;
};
#define CONTAINER_RNA_ID(cont) (*(const char **)(((ContainerRNA *)(cont))+1))