[cairo-commit] 2 commits - perf/cairo-perf-diff-files.c perf/.gitignore

Chris Wilson ickle at kemper.freedesktop.org
Mon Oct 26 04:04:53 PDT 2009


 perf/.gitignore              |    1 +
 perf/cairo-perf-diff-files.c |   22 +++++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit f648fcd2f91ea5c9ec318c2c0573ee82ac8c0ac9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Oct 26 11:02:16 2009 +0000

    gitignore: Add forgotten cairo-perf-print

diff --git a/perf/.gitignore b/perf/.gitignore
index 1e0fea3..3764715 100644
--- a/perf/.gitignore
+++ b/perf/.gitignore
@@ -2,6 +2,7 @@ TAGS
 tags
 cairo-perf
 cairo-perf-micro
+cairo-perf-print
 cairo-perf-trace
 cairo-perf-compare-backends
 cairo-perf-diff-files
commit 6911ba2f76d4ccdf228c029e2719461a72848824
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Oct 26 11:01:01 2009 +0000

    perf: Fix comparisons
    
    The sort order was unstable resulting in incorrect ordering dependent
    upon libc version.

diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c
index 2d3b085..a04014c 100644
--- a/perf/cairo-perf-diff-files.c
+++ b/perf/cairo-perf-diff-files.c
@@ -55,21 +55,29 @@ test_diff_cmp_speedup_before_slowdown (const void *a, const void *b)
     const test_diff_t *b_diff = b;
 
     /* First make all speedups come before all slowdowns. */
-    if (a_diff->change > 1.0 && b_diff->change < 1.0)
+    if (a_diff->change > 0 && b_diff->change < 0)
 	return -1;
-    if (a_diff->change < 1.0 && b_diff->change > 1.0)
+    if (a_diff->change < 0 && b_diff->change > 0)
 	return 1;
 
     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 (a_diff->change > 0) {
+	    if (a_diff->change > b_diff->change)
+		    return -1;
+	    else
+		    return 1;
+    }
 
     /* Large slowdowns come last. */
-    if (a_diff->change < 1. && a_diff->change < b_diff->change)
-	return 1;
+    if (a_diff->change < 0) {
+	    if (a_diff->change < b_diff->change)
+		    return 1;
+	    else
+		    return -1;
+    }
 
     return 0;
 }
@@ -95,7 +103,7 @@ test_diff_cmp (const void *a, const void *b)
 static void
 print_change_bar (double change, double max_change, int use_utf)
 {
-    int units_per_cell = (int) ceil (max_change / CHANGE_BAR_WIDTH);
+    int units_per_cell = ceil (max_change / CHANGE_BAR_WIDTH);
     static char const *ascii_boxes[8] = {
 	"****","***" ,"***", "**",
 	"**",  "*",   "*",   ""


More information about the cairo-commit mailing list