From 83e87655627fc2156a87dbfe2f676869b97fa8d2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 19 Nov 2019 16:47:41 +0100 Subject: 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. --- source/blender/blenkernel/intern/subdiv_foreach.c | 1 + 1 file changed, 1 insertion(+) 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(¶llel_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; } -- cgit v1.2.3