From 39b525e0f07fa25dcda54226ade789959b642dec Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 10 Jul 2020 12:05:31 +0200 Subject: Fix T78296: Performance - Use Binary Search for MDeformWeight Use binary search for querying deform weights. Spring 02_020_A.anim.blend on Ryzen 1700X goes from 12.4 to 12.7fps. During profiling it was detected that adding new items to the head was faster than adding to the tail. Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D8127 --- source/blender/makesdna/DNA_meshdata_types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesdna/DNA_meshdata_types.h') diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index cc2ba3fb999..a4299d3c6a2 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -286,6 +286,7 @@ typedef struct MDeformWeight { } MDeformWeight; typedef struct MDeformVert { + /* Mut be sorted by def_nr due to binary search. */ struct MDeformWeight *dw; int totweight; /** Flag is only in use as a run-time tag at the moment. */ -- cgit v1.2.3