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>2017-12-21 18:14:15 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-12-21 18:33:22 +0300
commit885bb5b137b5ea71869b741e6ee7acc1602ab5c6 (patch)
treec2f6170e2540106681a265a1aeab8b6dab622100 /source/blender/depsgraph/intern/nodes/deg_node.h
parentd988eae6f983c5ac148786689f75b95c4fa16dee (diff)
Depsgraph: Bring timing statistics to the new dependency graph
This statistics is only collected when debug_value is different from 0. Stored in depsgraph node itself, so we can always have access to average data and other stats which requires persistent storage. This way we also don't waste time trying to find stats from a separately stored hash map.
Diffstat (limited to 'source/blender/depsgraph/intern/nodes/deg_node.h')
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/nodes/deg_node.h b/source/blender/depsgraph/intern/nodes/deg_node.h
index cc741224c71..603a6be7ceb 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node.h
+++ b/source/blender/depsgraph/intern/nodes/deg_node.h
@@ -56,6 +56,19 @@ struct DepsNode {
const char *tname;
int id_recalc_tag;
};
+ struct Stats {
+ Stats();
+ /* Reset all the counters. Including all stats needed for average
+ * evaluation time calculation.
+ */
+ void reset();
+ /* Reset counters needed for the current graph evaluation, does not
+ * touch averaging accumulators.
+ */
+ void reset_current();
+ /* Time spend on this node during current graph evaluation. */
+ double current_time;
+ };
/* Relationships between nodes
* The reason why all depsgraph nodes are descended from this type (apart
* from basic serialization benefits - from the typeinfo) is that we can have
@@ -67,7 +80,8 @@ struct DepsNode {
eDepsNode_Type type; /* Structural type of node. */
Relations inlinks; /* Nodes which this one depends on. */
Relations outlinks; /* Nodes which depend on this one. */
- int done; /* Generic tags for traversal algorithms. */
+ int done; /* Generic tags for traversal algorithms. */
+ Stats stats; /* Evaluation statistics. */
/* Methods. */
DepsNode();