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
This commit is contained in:
2022-09-20 10:59:12 +02:00
parent 7a239812ca
commit 5c81d3bd46
13 changed files with 447 additions and 109 deletions

View File

@@ -14,7 +14,7 @@ BasicParams::BasicParams(const LazyFunction &fn,
MutableSpan<std::optional<ValueUsage>> input_usages,
Span<ValueUsage> output_usages,
MutableSpan<bool> set_outputs)
: Params(fn),
: Params(fn, true),
inputs_(inputs),
outputs_(outputs),
input_usages_(input_usages),
@@ -62,4 +62,9 @@ void BasicParams::set_input_unused_impl(const int index)
input_usages_[index] = ValueUsage::Unused;
}
bool BasicParams::try_enable_multi_threading_impl()
{
return true;
}
} // namespace blender::fn::lazy_function