Page MenuHome

BLI_bvhtree_overlap does not work multithreaded

Authored by Germano Cavalcante (mano-wii) on Sat, Jan 4, 4:49 AM.



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.

This patch proposes to run in multi-thread by setting the maximum
number of items per thread to 1.

Although I expected an even greater performance improvement, in my
tests the cloth collision system (which calls that function) went
from 0.80fps to 0.88fps.

It's something.

Diff Detail

rB Blender

Event Timeline

This parameter is always a bot tricky to set properly… But yes, when those callbacks are heavy processing, then indeed min_iter_per_thread should be forced to 1.

This revision is now accepted and ready to land.Sat, Jan 4, 9:12 AM