[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?
This commit is contained in:
Chris Wilson 2009-07-31 09:36:10 +01:00
parent 877ed645f9
commit ce8a8424aa

View file

@ -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;