mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 06:00:10 +01:00
[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.
This commit is contained in:
parent
b7c03d4e40
commit
55f4e0e4e8
11 changed files with 59 additions and 47 deletions
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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[] = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue