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>2018-02-22 12:35:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-02-22 12:35:04 +0300
commit9729726aa85f460d34e62b81733371c321b18e48 (patch)
tree9426b10ac32e17b457d9ea15180269e3b6be9056
parent632d66eb89066a3101af2b5c34b95db989074093 (diff)
Depsgraph: Report graph construction time when run with --debug-depsgraph-build
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index a04e59160c8..1b270e71d64 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -32,15 +32,11 @@
#include "MEM_guardedalloc.h"
-// #define DEBUG_TIME
-
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
-#ifdef DEBUG_TIME
-# include "PIL_time.h"
-# include "PIL_time_utildefines.h"
-#endif
+#include "PIL_time.h"
+#include "PIL_time_utildefines.h"
extern "C" {
#include "DNA_cachefile_types.h"
@@ -200,9 +196,10 @@ void DEG_add_special_eval_flag(Depsgraph *graph, ID *id, short flag)
*/
void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene)
{
-#ifdef DEBUG_TIME
- TIMEIT_START(DEG_graph_build_from_scene);
-#endif
+ double start_time;
+ if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) {
+ start_time = PIL_check_seconds_timer();
+ }
DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
@@ -240,9 +237,10 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene)
}
#endif
-#ifdef DEBUG_TIME
- TIMEIT_END(DEG_graph_build_from_scene);
-#endif
+ if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) {
+ printf("Depsgraph built in %f seconds.\n",
+ PIL_check_seconds_timer() - start_time);
+ }
}
/* Tag graph relations for update. */