diff options
author | mano-wii <germano.costa@ig.com.br> | 2020-01-04 14:36:47 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2020-01-04 14:36:47 +0300 |
commit | 0ac41dea7e21fb5c9388f8b72b8c6b6dfb005046 (patch) | |
tree | d0a87593e667b596d9b235d07b24b42838246d1a /source/blender/blenlib/intern/BLI_kdopbvh.c | |
parent | 8314e201398a22522e25eb3254d5b47f4f3f65f4 (diff) |
BLI_bvhtree_overlap does not work multithreaded
`BLI_task_parallel_range` counts the number of tasks depending on the
number of items.
In the case of `BLI_bvhtree_overlap` the number of items is always
between 2 and 16, which makes it always run in single thread.
So, set the maximum number of items per thread to 1.
In my tests the cloth collision system (which calls that function)
went from 0.80fps to 0.88fps.
Differential Revision: https://developer.blender.org/D6523
Diffstat (limited to 'source/blender/blenlib/intern/BLI_kdopbvh.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d5bedaadb8b..5a34626e335 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1344,6 +1344,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap_ex( if (use_threading) { TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); + settings.min_iter_per_thread = 1; BLI_task_parallel_range(0, root_node_len, data, |