[Bf-blender-cvs] [83e87655627] master: Subdiv: Tweak threading settings

Sergey Sharybin noreply at git.blender.org
Tue Nov 19 17:00:35 CET 2019


Commit: 83e87655627fc2156a87dbfe2f676869b97fa8d2
Author: Sergey Sharybin
Date:   Tue Nov 19 16:47:41 2019 +0100
Branches: master
https://developer.blender.org/rB83e87655627fc2156a87dbfe2f676869b97fa8d2

Subdiv: Tweak threading settings

Ensure that all threads on a multi-core system are used.

The issue was that BLI_task module was trying to be smart and
used heuristic to find optimal number of iterations per thread.
This heuristic assumes that tasks are light-weight, which is
not a case for subdivision surface.

On a higher subdivision level with a file from T70826 the
evaluation time goes down from 0.25 to 0.17 seconds per modifier
evaluation.

When D6189 is finalized we can being some extra performance
improvement.

===================================================================

M	source/blender/blenkernel/intern/subdiv_foreach.c

===================================================================

diff --git a/source/blender/blenkernel/intern/subdiv_foreach.c b/source/blender/blenkernel/intern/subdiv_foreach.c
index f9039767f53..37e47cc5b10 100644
--- a/source/blender/blenkernel/intern/subdiv_foreach.c
+++ b/source/blender/blenkernel/intern/subdiv_foreach.c
@@ -1825,6 +1825,7 @@ bool BKE_subdiv_foreach_subdiv_geometry(Subdiv *subdiv,
   BLI_parallel_range_settings_defaults(&parallel_range_settings);
   parallel_range_settings.userdata_chunk = context->user_data_tls;
   parallel_range_settings.userdata_chunk_size = context->user_data_tls_size;
+  parallel_range_settings.min_iter_per_thread = 1;
   if (context->user_data_tls_free != NULL) {
     parallel_range_settings.func_finalize = subdiv_foreach_finalize;
   }



More information about the Bf-blender-cvs mailing list