diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-22 14:57:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-22 14:57:08 +0300 |
commit | 8553449cf2d659ef5c05bcfc02ac27d3ede6d4e4 (patch) | |
tree | 83d8b60c74a6bbdd7ace84a4085ad4a5e79d33db /source | |
parent | af83535dd0f2032c72abd62254f566da2db9f65b (diff) |
Task scheduler: Start with suspended pool to avoid threading overhead on push
The idea is to avoid any threading overhead when we start pushing tasks in a
loop. Similarly to how we do it from the new dependency graph. Gives couple of
percent of speedup here, but also improves scalability.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/task.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c index da632e92e08..a064c69e8a5 100644 --- a/source/blender/blenlib/intern/task.c +++ b/source/blender/blenlib/intern/task.c @@ -1101,7 +1101,7 @@ static void task_parallel_range_ex( } task_scheduler = BLI_task_scheduler_get(); - task_pool = BLI_task_pool_create(task_scheduler, &state); + task_pool = BLI_task_pool_create_suspended(task_scheduler, &state); num_threads = BLI_task_scheduler_num_threads(task_scheduler); /* The idea here is to prevent creating task for each of the loop iterations @@ -1328,7 +1328,7 @@ void BLI_task_parallel_listbase( } task_scheduler = BLI_task_scheduler_get(); - task_pool = BLI_task_pool_create(task_scheduler, &state); + task_pool = BLI_task_pool_create_suspended(task_scheduler, &state); num_threads = BLI_task_scheduler_num_threads(task_scheduler); /* The idea here is to prevent creating task for each of the loop iterations |