summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;