diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-11 16:47:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-11 16:48:49 +0300 |
commit | 1255f572c76d989e9acf86d1d6089303406bc72f (patch) | |
tree | 8ece37721a2b0f4f3afb43653f67a1a79ceb6ec1 /source/blender/depsgraph | |
parent | 498ffef7b054c08a1d05271aeb4fde5eeeebf450 (diff) |
Depsgraph: Make eval initialization more friendly for threading
Helps in cases of not very complex scenes and lots of system threads available.
A bit hard to measure change on it's own, it works best with the upcoming
changes and gives measurable improvements.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval.cc | 3 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 76e76b5eb7b..c29a0708cef 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -144,13 +144,12 @@ static void calculate_pending_func( static void calculate_pending_parents(Depsgraph *graph, unsigned int layers) { const int num_operations = graph->operations.size(); - const bool do_threads = (num_operations > 256); CalculatePengindData data; data.graph = graph; data.layers = layers; ParallelRangeSettings settings; BLI_parallel_range_settings_defaults(&settings); - settings.use_threading = do_threads; + settings.min_iter_per_thread = 1024; BLI_task_parallel_range(0, num_operations, &data, diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 9e910afea07..daf008ddb7d 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -112,7 +112,7 @@ BLI_INLINE void flush_prepare(Depsgraph *graph) const int num_operations = graph->operations.size(); ParallelRangeSettings settings; BLI_parallel_range_settings_defaults(&settings); - settings.use_threading = (num_operations > 256); + settings.min_iter_per_thread = 1024; BLI_task_parallel_range(0, num_operations, graph, flush_init_operation_node_func, @@ -122,7 +122,7 @@ BLI_INLINE void flush_prepare(Depsgraph *graph) const int num_id_nodes = graph->id_nodes.size(); ParallelRangeSettings settings; BLI_parallel_range_settings_defaults(&settings); - settings.use_threading = (num_id_nodes > 256); + settings.min_iter_per_thread = 1024; BLI_task_parallel_range(0, num_id_nodes, graph, flush_init_id_node_func, @@ -311,10 +311,9 @@ void deg_graph_clear_tags(Depsgraph *graph) { /* Go over all operation nodes, clearing tags. */ const int num_operations = graph->operations.size(); - const bool do_threads = num_operations > 256; ParallelRangeSettings settings; BLI_parallel_range_settings_defaults(&settings); - settings.use_threading = do_threads; + settings.min_iter_per_thread = 1024; BLI_task_parallel_range(0, num_operations, graph, graph_clear_func, |