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.
This commit is contained in:
parent
c66983c5c8
commit
50f1c9a8af
Notes:
blender-bot
2023-02-14 07:39:44 +01:00
Referenced by issue #53683, 2.79a release
|
@ -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
|
||||
|
@ -1325,7 +1325,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
|
||||
|
@ -1413,7 +1413,7 @@ void BLI_task_parallel_mempool(
|
|||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue