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.
This commit is contained in:
Sergey Sharybin
2019-11-19 16:47:41 +01:00
parent 6fea251e01
commit 83e8765562

View File

@@ -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;
}