From 55f4e0e4e8c7df59bfc9e6ffea8daa065276e42f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 30 May 2009 16:50:17 +0100 Subject: [PATCH] [perf] Change seperators from '-' to '.' This allows the perf tests to use '-' in the name which is easier to read and differentiates with using '_' to separate source and operators. --- perf/cairo-perf-compare-backends.c | 22 ++++++++++---------- perf/cairo-perf-cover.c | 32 +++++++++++++++--------------- perf/cairo-perf-report.c | 16 ++++++++++++--- perf/cairo-perf.c | 8 ++++---- perf/mosaic.c | 8 ++++---- perf/pattern_create_radial.c | 4 ++-- perf/pythagoras-tree.c | 2 +- perf/subimage_copy.c | 4 ++-- perf/unaligned-clip.c | 2 +- perf/world-map.c | 4 ++-- perf/zrusin.c | 4 ++-- 11 files changed, 59 insertions(+), 47 deletions(-) diff --git a/perf/cairo-perf-compare-backends.c b/perf/cairo-perf-compare-backends.c index e6ab37ff3..3f280ce9f 100644 --- a/perf/cairo-perf-compare-backends.c +++ b/perf/cairo-perf-compare-backends.c @@ -225,18 +225,20 @@ cairo_perf_reports_compare (cairo_perf_report_t *reports, test_report_cmp_name (tests[i], min_test) == 0) { test_time = tests[i]->stats.min_ticks; - if (options->use_ms) - test_time /= tests[i]->stats.ticks_per_ms; - if (diff->num_tests == 0) { - diff->min = test_time; - diff->max = test_time; - } else { - if (test_time < diff->min) + if (test_time > 0) { + if (options->use_ms) + test_time /= tests[i]->stats.ticks_per_ms; + if (diff->num_tests == 0) { diff->min = test_time; - if (test_time > diff->max) diff->max = test_time; + } else { + if (test_time < diff->min) + diff->min = test_time; + if (test_time > diff->max) + diff->max = test_time; + } + diff->tests[diff->num_tests++] = tests[i]; } - diff->tests[diff->num_tests++] = tests[i]; tests[i]++; } } @@ -366,7 +368,7 @@ main (int argc, const char *argv[]) if (args.num_filenames < 1) usage (argv[0]); - reports = xmalloc (args.num_filenames * sizeof (cairo_perf_report_t)); + reports = xcalloc (args.num_filenames, sizeof (cairo_perf_report_t)); for (i = 0; i < args.num_filenames; i++) { cairo_perf_report_load (&reports[i], args.filenames[i], diff --git a/perf/cairo-perf-cover.c b/perf/cairo-perf-cover.c index 18a1588e5..48f13a8b4 100644 --- a/perf/cairo-perf-cover.c +++ b/perf/cairo-perf-cover.c @@ -301,22 +301,22 @@ cairo_perf_cover_sources_and_operators (cairo_perf_t *perf, char *expanded_name; struct { set_source_func_t set_source; const char *name; } sources[] = { - { set_source_solid_rgb, "solid_rgb" }, - { set_source_solid_rgba, "solid_rgba" }, - { set_source_image_surface_rgb, "image_rgb" }, - { set_source_image_surface_rgba, "image_rgba" }, - { set_source_image_surface_rgba_mag, "image_rgba_mag" }, - { set_source_image_surface_rgba_min, "image_rgba_min" }, - { set_source_similar_surface_rgb, "similar_rgb" }, - { set_source_similar_surface_rgba, "similar_rgba" }, - { set_source_similar_surface_rgba_mag, "similar_rgba_mag" }, - { set_source_similar_surface_rgba_min, "similar_rgba_min" }, - { set_source_linear_rgb, "linear_rgb" }, - { set_source_linear_rgba, "linear_rgba" }, - { set_source_linear3_rgb, "linear3_rgb" }, - { set_source_linear3_rgba, "linear3_rgba" }, - { set_source_radial_rgb, "radial_rgb" }, - { set_source_radial_rgba, "radial_rgba" } + { set_source_solid_rgb, "solid-rgb" }, + { set_source_solid_rgba, "solid-rgba" }, + { set_source_image_surface_rgb, "image-rgb" }, + { set_source_image_surface_rgba, "image-rgba" }, + { set_source_image_surface_rgba_mag, "image-rgba-mag" }, + { set_source_image_surface_rgba_min, "image-rgba-min" }, + { set_source_similar_surface_rgb, "similar-rgb" }, + { set_source_similar_surface_rgba, "similar-rgba" }, + { set_source_similar_surface_rgba_mag, "similar-rgba-mag" }, + { set_source_similar_surface_rgba_min, "similar-rgba-min" }, + { set_source_linear_rgb, "linear-rgb" }, + { set_source_linear_rgba, "linear-rgba" }, + { set_source_linear3_rgb, "linear3-rgb" }, + { set_source_linear3_rgba, "linear3-rgba" }, + { set_source_radial_rgb, "radial-rgb" }, + { set_source_radial_rgba, "radial-rgba" } }; struct { cairo_operator_t op; const char *name; } operators[] = { diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c index 8a99b9d2b..a73538bb6 100644 --- a/perf/cairo-perf-report.c +++ b/perf/cairo-perf-report.c @@ -148,7 +148,7 @@ test_report_parse (test_report_t *report, char *line, char *configuration) report->configuration = configuration; parse_string (report->backend); - end = strrchr (report->backend, '-'); + end = strrchr (report->backend, '.'); if (*end) *end++ = '\0'; report->content = end; @@ -156,7 +156,7 @@ test_report_parse (test_report_t *report, char *line, char *configuration) skip_space (); parse_string (report->name); - end = strrchr (report->name, '-'); + end = strrchr (report->name, '.'); if (*end) *end++ = '\0'; report->size = atoi (end); @@ -173,13 +173,23 @@ test_report_parse (test_report_t *report, char *line, char *configuration) report->samples_size = 5; report->samples = xmalloc (report->samples_size * sizeof (cairo_perf_ticks_t)); + report->stats.min_ticks = 0; do { if (report->samples_count == report->samples_size) { report->samples_size *= 2; report->samples = xrealloc (report->samples, report->samples_size * sizeof (cairo_perf_ticks_t)); } - parse_long_long (report->samples[report->samples_count++]); + parse_long_long (report->samples[report->samples_count]); + if (report->samples_count == 0) { + report->stats.min_ticks = + report->samples[report->samples_count]; + } else if (report->stats.min_ticks > + report->samples[report->samples_count]){ + report->stats.min_ticks = + report->samples[report->samples_count]; + } + report->samples_count++; skip_space (); } while (*s && *s != '\n'); report->stats.iterations = 0; diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index d7a7e889d..64136e0a9 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -174,10 +174,10 @@ cairo_perf_run (cairo_perf_t *perf, if (first_run) { if (perf->raw) - printf ("[ # ] %s-%-s %s %s %s ...\n", + printf ("[ # ] %s.%-s %s %s %s ...\n", "backend", "content", "test-size", "ticks-per-ms", "time(ticks)"); else - printf ("[ # ] %8s-%-4s %28s %8s %8s %5s %5s %s\n", + printf ("[ # ] %8s.%-4s %28s %8s %8s %5s %5s %s\n", "backend", "content", "test-size", "min(ticks)", "min(ms)", "median(ms)", "stddev.", "iterations"); first_run = FALSE; @@ -208,7 +208,7 @@ cairo_perf_run (cairo_perf_t *perf, if (perf->raw) { if (i == 0) - printf ("[*] %s-%s %s-%d %g", + printf ("[*] %s.%s %s.%d %g", perf->target->name, _content_to_string (perf->target->content, similar), name, perf->size, @@ -234,7 +234,7 @@ cairo_perf_run (cairo_perf_t *perf, printf ("\n"); } else { _cairo_stats_compute (&stats, times, i); - printf ("[%3d] %8s-%-5s %26s-%-3d ", + printf ("[%3d] %8s.%-5s %26s.%-3d ", perf->test_number, perf->target->name, _content_to_string (perf->target->content, similar), name, perf->size); diff --git a/perf/mosaic.c b/perf/mosaic.c index 257a36264..bab627656 100644 --- a/perf/mosaic.c +++ b/perf/mosaic.c @@ -164,8 +164,8 @@ mosaic (cairo_perf_t *perf, cairo_t *cr, int width, int height) if (! cairo_perf_can_run (perf, "mosaic")) return; - cairo_perf_run (perf, "mosaic_fill_curves", mosaic_fill_curves); - cairo_perf_run (perf, "mosaic_fill_lines", mosaic_fill_lines); - cairo_perf_run (perf, "mosaic_tessellate_curves", mosaic_tessellate_curves); - cairo_perf_run (perf, "mosaic_tessellate_lines", mosaic_tessellate_lines); + cairo_perf_run (perf, "mosaic-fill-curves", mosaic_fill_curves); + cairo_perf_run (perf, "mosaic-fill-lines", mosaic_fill_lines); + cairo_perf_run (perf, "mosaic-tessellate-curves", mosaic_tessellate_curves); + cairo_perf_run (perf, "mosaic-tessellate-lines", mosaic_tessellate_lines); } diff --git a/perf/pattern_create_radial.c b/perf/pattern_create_radial.c index 8fa683b81..b9081515d 100644 --- a/perf/pattern_create_radial.c +++ b/perf/pattern_create_radial.c @@ -82,7 +82,7 @@ pattern_create_radial (cairo_perf_t *perf, cairo_t *cr, int width, int height) { int i; - if (! cairo_perf_can_run (perf, "pattern_create_radial")) + if (! cairo_perf_can_run (perf, "pattern-create-radial")) return; srand (time (0)); @@ -96,6 +96,6 @@ pattern_create_radial (cairo_perf_t *perf, cairo_t *cr, int width, int height) radials[i].radius1 = generate_double_in_range (0.0, 1000.0); } - cairo_perf_run (perf, "pattern_create_radial", + cairo_perf_run (perf, "pattern-create-radial", do_pattern_create_radial); } diff --git a/perf/pythagoras-tree.c b/perf/pythagoras-tree.c index 750e83b2a..a1cce5c02 100644 --- a/perf/pythagoras-tree.c +++ b/perf/pythagoras-tree.c @@ -82,7 +82,7 @@ do_pythagoras_tree (cairo_t *cr, int width, int height) void pythagoras_tree (cairo_perf_t *perf, cairo_t *cr, int width, int height) { - if (! cairo_perf_can_run (perf, "pythagoras_tree")) + if (! cairo_perf_can_run (perf, "pythagoras-tree")) return; cairo_perf_run (perf, "pythagoras_tree", do_pythagoras_tree); diff --git a/perf/subimage_copy.c b/perf/subimage_copy.c index 722705b4f..25b16cc2c 100644 --- a/perf/subimage_copy.c +++ b/perf/subimage_copy.c @@ -55,7 +55,7 @@ subimage_copy (cairo_perf_t *perf, cairo_t *cr, int width, int height) cairo_surface_t *image; cairo_t *cr2; - if (! cairo_perf_can_run (perf, "subimage_copy")) + if (! cairo_perf_can_run (perf, "subimage-copy")) return; cairo_set_source_rgb (cr, 0, 0, 1); /* blue */ @@ -70,5 +70,5 @@ subimage_copy (cairo_perf_t *perf, cairo_t *cr, int width, int height) cairo_set_source_surface (cr, image, 0, 0); cairo_surface_destroy (image); - cairo_perf_run (perf, "subimage_copy", do_subimage_copy); + cairo_perf_run (perf, "subimage-copy", do_subimage_copy); } diff --git a/perf/unaligned-clip.c b/perf/unaligned-clip.c index a757fa671..7fd5245e1 100644 --- a/perf/unaligned-clip.c +++ b/perf/unaligned-clip.c @@ -62,5 +62,5 @@ unaligned_clip (cairo_perf_t *perf, cairo_t *cr, int width, int height) if (! cairo_perf_can_run (perf, "unaligned-clip")) return; - cairo_perf_run (perf, "unaligned_clip", do_unaligned_clip); + cairo_perf_run (perf, "unaligned-clip", do_unaligned_clip); } diff --git a/perf/world-map.c b/perf/world-map.c index 5b8be4537..5a53f308c 100644 --- a/perf/world-map.c +++ b/perf/world-map.c @@ -105,8 +105,8 @@ do_world_map (cairo_t *cr, int width, int height) void world_map (cairo_perf_t *perf, cairo_t *cr, int width, int height) { - if (! cairo_perf_can_run (perf, "world_map")) + if (! cairo_perf_can_run (perf, "world-map")) return; - cairo_perf_run (perf, "world_map", do_world_map); + cairo_perf_run (perf, "world-map", do_world_map); } diff --git a/perf/zrusin.c b/perf/zrusin.c index 219561592..9393932b4 100644 --- a/perf/zrusin.c +++ b/perf/zrusin.c @@ -88,6 +88,6 @@ zrusin (cairo_perf_t *perf, cairo_t *cr, int width, int height) if (! cairo_perf_can_run (perf, "zrusin")) return; - cairo_perf_run (perf, "zrusin_another_tessellate", zrusin_another_tessellate); - cairo_perf_run (perf, "zrusin_another_fill", zrusin_another_fill); + cairo_perf_run (perf, "zrusin-another-tessellate", zrusin_another_tessellate); + cairo_perf_run (perf, "zrusin-another-fill", zrusin_another_fill); }