diff options
author | Jacques Lucke <jacques@blender.org> | 2022-09-20 11:59:12 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-09-20 12:08:05 +0300 |
commit | 5c81d3bd4691214164a7f071d239ef6c84dba8dc (patch) | |
tree | cbab752ca58da40b45c15540707a2b0a22d769da /source/blender/blenlib/intern/task_range.cc | |
parent | 7a239812ca55153fc9751b6a87bc5c4deb76456b (diff) |
Geometry Nodes: improve evaluator with lazy threading
In large node setup the threading overhead was sometimes very significant.
That's especially true when most nodes do very little work.
This commit improves the scheduling by not using multi-threading in many
cases unless it's likely that it will be worth it. For more details see the comments
in `BLI_lazy_threading.hh`.
Differential Revision: https://developer.blender.org/D15976
Diffstat (limited to 'source/blender/blenlib/intern/task_range.cc')
-rw-r--r-- | source/blender/blenlib/intern/task_range.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/task_range.cc b/source/blender/blenlib/intern/task_range.cc index 7e405529f03..181b760bea1 100644 --- a/source/blender/blenlib/intern/task_range.cc +++ b/source/blender/blenlib/intern/task_range.cc @@ -12,6 +12,7 @@ #include "DNA_listBase.h" +#include "BLI_lazy_threading.hh" #include "BLI_task.h" #include "BLI_threads.h" @@ -104,6 +105,8 @@ void BLI_task_parallel_range(const int start, const size_t grainsize = MAX2(settings->min_iter_per_thread, 1); const tbb::blocked_range<int> range(start, stop, grainsize); + blender::lazy_threading::send_hint(); + if (settings->func_reduce) { parallel_reduce(range, task); if (settings->userdata_chunk) { |