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:
authorSv. Lockal <lockalsash@gmail.com>2013-12-15 18:06:04 +0400
committerSv. Lockal <lockalsash@gmail.com>2013-12-15 18:06:04 +0400
commit2b0ba65c513b362617556551028360184f58ecc1 (patch)
treef24db0f5ab6b3b5a541cf6fab34d75363cae886f /source/blender/makesrna/intern/rna_define.c
parent4a141022c39cefd422e66772714f54ccb3ec7733 (diff)
Minor optimization for strlen and memcpy calls for reading blend files
Summary: This commit removes ~10000 strlen calls and ~100000 memcpy calls in blender (profiled with blender --background), ~10000 memcpy calls in makesdna. There is no need to create null-terminated strings for atoi, because it converts only the initial portion of the string anyway. Also it was noticed that DNA_elem_array_size and arraysize functions work only with full strings, so there is no point to calculate strlen. Reviewers: campbellbarton Reviewed By: campbellbarton Differential Revision: http://developer.blender.org/D105
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index fe38ce2d86a..3a5a1d30cd8 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -348,7 +348,7 @@ static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char *
if (strstr(membername, "["))
smember->arraylength = 0;
else
- smember->arraylength = DNA_elem_array_size(smember->name, strlen(smember->name));
+ smember->arraylength = DNA_elem_array_size(smember->name);
smember->pointerlevel = 0;
for (b = 0; dnaname[b] == '*'; b++)