Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-05-09 13:42:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-09 13:42:53 +0300
commit86a57b04bfa6730298dc8fafe0545f6929ee64a6 (patch)
treec2ad45b764d81c4c908e4d423d9da846f99071e2 /source/blender/depsgraph/intern/depsgraph_eval.cc
parent5dbeea95d0e1eb61eaa52dc5943d143f3b2e490c (diff)
Depsgraph: Store node input/output links in a vector rather than in set
Set is much slower to iterate through (due to cache misses and such) and the only advantage of using set is faster removal of link. However, we are iterating links much much more often than removing them, and even when we are removing links we don't really need to remove link from nodes which it connects -- we don't support partial depsgraph updates, so removing links from nodes on destruction is a waste of time. If we ever want to support partial updates we can have dedicated function to remove link from nodes it connects. This gives a surprising increase of fps from 42 to 56 with test file from Mr. J.P.Bouza (blenrig_for_debugging.blend). Surprising because old DEG is actually slower here (52 fps). Didn't see any regressions (and don't see why they will happen), so let's ask our riggers and animators to perform further speed tests ;)
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_eval.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index 15c8b1a9dd3..febea7d993d 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -281,21 +281,17 @@ static void schedule_children(TaskPool *pool,
OperationDepsNode *node,
const int layers)
{
- for (OperationDepsNode::Relations::const_iterator it = node->outlinks.begin();
- it != node->outlinks.end();
- ++it)
+ DEPSNODE_RELATIONS_ITER_BEGIN(node->outlinks, rel)
{
- DepsRelation *rel = *it;
OperationDepsNode *child = (OperationDepsNode *)rel->to;
BLI_assert(child->type == DEPSNODE_TYPE_OPERATION);
-
if (child->scheduled) {
/* Happens when having cyclic dependencies. */
continue;
}
-
schedule_node(pool, graph, layers, child, (rel->flag & DEPSREL_FLAG_CYCLIC) == 0);
}
+ DEPSNODE_RELATIONS_ITER_END;
}
/**