summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-31 09:36:10 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-31 09:43:12 +0100
commitce8a8424aa4331f119b115123faf7b773b5f25d0 (patch)
treefe9494011b9c556cbdeac342abc8d1a9d0cb2c73 /perf
parent877ed645f95ff048f7c5d2ce0fb92389918711a6 (diff)
[perf] Change the order of slowdowns.
More the large slowdowns to the end. This has two pleasing effects: 1. There is symmetry between large speedups at the top, and large slowdowns at the bottom, with long bars -> short bars -> long bars. 2. After a cairo-perf-diff run the largest slowdowns are immediately visible on the console. What better way to flag performance regressions?
Diffstat (limited to 'perf')
-rw-r--r--perf/cairo-perf-diff-files.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c
index adbe69ad..6870b80b 100644
--- a/perf/cairo-perf-diff-files.c
+++ b/perf/cairo-perf-diff-files.c
@@ -60,12 +60,15 @@ test_diff_cmp_speedup_before_slowdown (const void *a, const void *b)
if (a_diff->change < 1.0 && b_diff->change > 1.0)
return 1;
- /* Reverse sort by magnitude of change so larger changes come
- * first */
- if (fabs (a_diff->change) > fabs (b_diff->change))
+ if (a_diff->change == b_diff->change)
+ return 0;
+
+ /* Large speedups come first. */
+ if (a_diff->change > 1. && a_diff->change > b_diff->change)
return -1;
- if (fabs (a_diff->change) < fabs (b_diff->change))
+ /* Large slowdowns come last. */
+ if (a_diff->change < 1. && a_diff->change < b_diff->change)
return 1;
return 0;