Depsgraph: Print some statistics about transitive reduction
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 20 Dec 2017 15:19:40 +0000 (16:19 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 20 Dec 2017 15:19:40 +0000 (16:19 +0100)
source/blender/depsgraph/intern/builder/deg_builder_transitive.cc

index 30af0242aeb8e00d1aa8c365e9a5f072e597e1ce..7731b76c6b90956c7de3c6e25418000c1990cf31 100644 (file)
@@ -37,6 +37,7 @@
 #include "intern/nodes/deg_node_operation.h"
 
 #include "intern/depsgraph.h"
+#include "intern/depsgraph_intern.h"
 
 #include "util/deg_util_foreach.h"
 
@@ -79,6 +80,7 @@ static void deg_graph_tag_paths_recursive(DepsNode *node)
 
 void deg_graph_transitive_reduction(Depsgraph *graph)
 {
+       int num_removed_relations = 0;
        foreach (OperationDepsNode *target, graph->operations) {
                /* Clear tags. */
                foreach (OperationDepsNode *node, graph->operations) {
@@ -108,12 +110,14 @@ void deg_graph_transitive_reduction(Depsgraph *graph)
                        else if (rel->from->done & OP_REACHABLE) {
                                rel->unlink();
                                OBJECT_GUARDED_DELETE(rel, DepsRelation);
+                               ++num_removed_relations;
                        }
                        else {
                                ++it_rel;
                        }
                }
        }
+       DEG_DEBUG_PRINTF("Removed %d relations\n", num_removed_relations);
 }
 
 }  // namespace DEG