[cairo-commit] perf/cairo-perf-diff-files.c

Carl Worth cworth at kemper.freedesktop.org
Fri Apr 13 13:36:49 PDT 2007


 perf/cairo-perf-diff-files.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

New commits:
diff-tree ef3e13337e513cf470801cff5cd2b8fdcff1b6eb (from 7ead3e64f17fe302398ec60c61eaeaae4e9b18cf)
Author: Carl Worth <cworth at cworth.org>
Date:   Fri Apr 13 13:34:20 2007 -0700

    cairo-perf-diff: Use median not minimum to report differences
    
    Ideally, the minimum value would indicate the best possible performance,
    but I've encountered situations where a bogus minimum value gets lodged
    into the cached results for some reason, (and yet doesn't also get
    discarded as an outlier). The downside of that situation is that running
    more iterations never changes the result, so it's hard to fix the problem,
    (resulting in cairo-perf-diff feeling just plain broken as more runs
    change nothing).
    
    So let's try using the median time instead.

diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c
index 8b6292a..e538379 100644
--- a/perf/cairo-perf-diff-files.c
+++ b/perf/cairo-perf-diff-files.c
@@ -536,11 +536,11 @@ cairo_perf_report_diff (cairo_perf_repor
 	diffs[num_diffs].new = n;
 	if (args->use_ms) {
 	    diffs[num_diffs].speedup =
-		(double) (o->stats.min_ticks / o->stats.ticks_per_ms)
-		       / (n->stats.min_ticks / n->stats.ticks_per_ms);
+		(double) (o->stats.median_ticks / o->stats.ticks_per_ms)
+		       / (n->stats.median_ticks / n->stats.ticks_per_ms);
 	} else {
 	    diffs[num_diffs].speedup =
-		(double) o->stats.min_ticks / n->stats.min_ticks;
+		(double) o->stats.median_ticks / n->stats.median_ticks;
 	}
 	num_diffs++;
 
@@ -591,9 +591,9 @@ cairo_perf_report_diff (cairo_perf_repor
 	printf ("%5s-%-4s %26s-%-3d  %6.2f %4.2f%% -> %6.2f %4.2f%%: %5.2fx ",
 		diff->old->backend, diff->old->content,
 		diff->old->name, diff->old->size,
-		diff->old->stats.min_ticks / diff->old->stats.ticks_per_ms,
+		diff->old->stats.median_ticks / diff->old->stats.ticks_per_ms,
 		diff->old->stats.std_dev * 100,
-		diff->new->stats.min_ticks / diff->new->stats.ticks_per_ms,
+		diff->new->stats.median_ticks / diff->new->stats.ticks_per_ms,
 		diff->new->stats.std_dev * 100,
 		change);
 


More information about the cairo-commit mailing list