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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user