Commit: b0ad161b9f6de4201ce3abc6f84c71159e6e346b
Author: Lukas Tönne
Date:   Wed May 28 08:30:55 2014 +0200
https://developer.blender.org/rBb0ad161b9f6de4201ce3abc6f84c71159e6e346b

Don't delete all depsgraph stats on every eval, since most of the time
this won't update the majority of data anyway and just delete info.

===================================================================

M       source/blender/depsgraph/DEG_depsgraph_debug.h
M       source/blender/depsgraph/intern/depsgraph_debug.cpp

===================================================================

diff --git a/source/blender/depsgraph/DEG_depsgraph_debug.h 
b/source/blender/depsgraph/DEG_depsgraph_debug.h
index 0ebcc59..ce5ea26 100644
--- a/source/blender/depsgraph/DEG_depsgraph_debug.h
+++ b/source/blender/depsgraph/DEG_depsgraph_debug.h
@@ -47,7 +47,7 @@ struct DepsRelation;
 /* Statistics */
 
 typedef struct DepsgraphStatsTimes {
-       float last;
+       float duration_last;
 } DepsgraphStatsTimes;
 
 typedef struct DepsgraphStatsComponent {
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cpp 
b/source/blender/depsgraph/intern/depsgraph_debug.cpp
index e207c7b..c415850 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cpp
@@ -740,16 +740,14 @@ void DepsgraphDebug::task_completed(const DepsgraphTask 
&task, double time)
        ComponentDepsNode *comp = node->owner;
        ID *id = comp->owner->id;
        
-//     printf("%s %s : %s took %f ms\n", BKE_idcode_to_name(GS(id->name)), 
id->name+2, comp->name.c_str(), time);
-       
        DepsgraphStatsID *id_stats = get_id_stats(id, true);
-       id_stats->times.last += time;
+       id_stats->times.duration_last += time;
        
        /* XXX TODO use something like: if (id->flag & ID_DEG_DETAILS) {...} */
        if (0) {
                /* XXX component name usage needs cleanup! currently mixes 
identifier and description strings! */
                DepsgraphStatsComponent *comp_stats = get_component_stats(id, 
get_component_name(comp->type, comp->name), true);
-               comp_stats->times.last += time;
+               comp_stats->times.duration_last += time;
        }
        
        BLI_mutex_unlock(&stats_mutex);
@@ -808,7 +806,12 @@ void DepsgraphDebug::reset_stats()
        if (!stats)
                return;
        
-       BLI_ghash_clear(stats->id_stats, NULL, deg_id_stats_free);
+       /* XXX this doesn't work, will immediately clear all info,
+        * since most depsgraph updates have none or very few updates to handle.
+        *
+        * Could consider clearing only zero-user ID blocks here
+        */
+//     BLI_ghash_clear(stats->id_stats, NULL, deg_id_stats_free);
 }
 
 DepsgraphStatsID *DepsgraphDebug::get_id_stats(ID *id, bool create)

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to