From eabf79e40ad64c1e80c9c52227099e211c6092af Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 22 Dec 2015 17:08:52 +0100 Subject: Get rid of OMP in MOD_build. Reasons: - Only parallelized piece of code gives little local speedup (code block only about 25% quicker even on 1M polys cube). - No gain nor loss using new BLI_task system. - At 10% of build, parallelized piece of code is only about 5% of total func runtime (run-time explodes as build proportion increases). See no point in adding (in utmost best optimistic case, in real use-case, when depsgraph will likely already fire several evaluations in parallel, speedup would be even smaller) 1% speedup here at the cost of threading complexity... Note that since later code uses hashes, I don't think it's easy to thread it, so think we can leave with it for now. --- source/blender/modifiers/intern/MOD_build.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_build.c') diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 507fad466a3..a364eef2974 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -106,15 +106,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), edgeMap = MEM_mallocN(sizeof(*edgeMap) * numEdge_src, "build modifier edgeMap"); faceMap = MEM_mallocN(sizeof(*faceMap) * numPoly_src, "build modifier faceMap"); -#pragma omp parallel sections if (numVert_src + numEdge_src + numPoly_src >= BKE_MESH_OMP_LIMIT) - { -#pragma omp section - { range_vn_i(vertMap, numVert_src, 0); } -#pragma omp section - { range_vn_i(edgeMap, numEdge_src, 0); } -#pragma omp section - { range_vn_i(faceMap, numPoly_src, 0); } - } + range_vn_i(vertMap, numVert_src, 0); + range_vn_i(edgeMap, numEdge_src, 0); + range_vn_i(faceMap, numPoly_src, 0); frac = (BKE_scene_frame_get(md->scene) - bmd->start) / bmd->length; CLAMP(frac, 0.0f, 1.0f); -- cgit v1.2.3