[Bf-blender-cvs] [f87fbf9cce6] blender2.8: Depsgraph: Gnuplot, put heaviest objects at the top

Sergey Sharybin noreply at git.blender.org
Mon Sep 17 11:19:49 CEST 2018


Commit: f87fbf9cce6a6d732f0364b41fd0885337268bee
Author: Sergey Sharybin
Date:   Fri Sep 14 15:47:37 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf87fbf9cce6a6d732f0364b41fd0885337268bee

Depsgraph: Gnuplot, put heaviest objects at the top

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

M	source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc

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

diff --git a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc
index 47b4895942e..0ea9f564fb1 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc
@@ -84,7 +84,7 @@ BLI_INLINE double get_node_time(const DebugContext& /*ctx*/,
 
 bool stat_entry_comparator(const StatsEntry& a, const StatsEntry& b)
 {
-	return a.time < b.time;
+	return a.time > b.time;
 }
 
 string gnuplotify_id_code(const string& name)
@@ -125,6 +125,7 @@ void write_stats_data(const DebugContext& ctx)
 	std::sort(stats.begin(), stats.end(), stat_entry_comparator);
 	// We limit number of entries, otherwise things become unreadable.
 	stats.resize(min_ii(stats.size(), 32));
+	std::reverse(stats.begin(), stats.end());
 	// Print data to the file stream.
 	deg_debug_fprintf(ctx, "$data << EOD" NL);
 	foreach (const StatsEntry& entry, stats) {



More information about the Bf-blender-cvs mailing list