Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIliay Katueshenock <Moder>2022-07-26 12:06:49 +0300
committerJacques Lucke <jacques@blender.org>2022-07-26 12:10:16 +0300
commitc94ca54cdafdba15d5a7be55e81d6f7a0da7ed7e (patch)
treefe6644d41f65b4e1d5861c33b465b6371b49306c /source/blender/blenkernel
parent203e7ba3320e7ed978ec094efa0c1b22137fb12a (diff)
BLI: add use_threading parameter to parallel_invoke
`parallel_invoke` allows executing functions on separate threads. However, creating tasks in tbb has a measurable amount of overhead. Therefore, it can be benefitial to disable parallelization when the amount of work done per function is small. See D15539 for some benchmark results. Differential Revision: https://developer.blender.org/D15539
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/curves_geometry.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc
index 3050e01e528..6486be4afe0 100644
--- a/source/blender/blenkernel/intern/curves_geometry.cc
+++ b/source/blender/blenkernel/intern/curves_geometry.cc
@@ -1165,6 +1165,7 @@ static CurvesGeometry copy_with_removed_points(const CurvesGeometry &curves,
CurvesGeometry new_curves{new_point_count, new_curve_count};
threading::parallel_invoke(
+ 256 < new_point_count * new_curve_count,
/* Initialize curve offsets. */
[&]() { new_curves.offsets_for_write().copy_from(new_curve_offsets); },
[&]() {
@@ -1237,6 +1238,7 @@ static CurvesGeometry copy_with_removed_curves(const CurvesGeometry &curves,
CurvesGeometry new_curves{new_tot_points, new_tot_curves};
threading::parallel_invoke(
+ 256 < new_tot_points * new_tot_curves,
/* Initialize curve offsets. */
[&]() {
MutableSpan<int> new_offsets = new_curves.offsets_for_write();