[Bf-blender-cvs] [69b327d8dcf] master: Depsgraph: Report new depsgraph evaluation time

Sergey Sharybin noreply at git.blender.org
Thu Mar 22 16:41:23 CET 2018


Commit: 69b327d8dcf91cccedf08b9a50c92d5b3922449b
Author: Sergey Sharybin
Date:   Thu Mar 22 16:40:32 2018 +0100
Branches: master
https://developer.blender.org/rB69b327d8dcf91cccedf08b9a50c92d5b3922449b

Depsgraph: Report new depsgraph evaluation time

Timing is printed to the console when running with --debug-depsgraph-time.

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

M	source/blender/depsgraph/intern/eval/deg_eval.cc

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

diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index 5f7bb4c3de5..92518ba73e4 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -261,6 +261,7 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
 	                 layers,
 	                 graph->layers);
 	const bool do_time_debug = ((G.debug & G_DEBUG_DEPSGRAPH_TIME) != 0);
+	const double start_time = do_time_debug ? PIL_check_seconds_timer() : 0;
 	/* Set time for the current graph evaluation context. */
 	TimeSourceDepsNode *time_src = graph->find_time_source();
 	eval_ctx->ctime = time_src->cfra;
@@ -300,6 +301,10 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
 	if (need_free_scheduler) {
 		BLI_task_scheduler_free(task_scheduler);
 	}
+	if (do_time_debug) {
+		printf("Depsgraph updated in %f seconds.\n",
+		       PIL_check_seconds_timer() - start_time);
+	}
 }
 
 }  // namespace DEG



More information about the Bf-blender-cvs mailing list