diff options
author | Carl Worth <cworth@cworth.org> | 2006-08-31 11:51:28 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-08-31 11:51:28 -0700 |
commit | 0c741675e1d43168f42ee530486bfa4b8ec54920 (patch) | |
tree | 6712450f0f65aad510f3dc89c2b933ad011ef095 /perf/cairo-perf.c | |
parent | fd13e874a778eeac4e2d358cc19b040aa20bcdf3 (diff) |
Make perf interface return a rate. Start print target and test names.
Diffstat (limited to 'perf/cairo-perf.c')
-rw-r--r-- | perf/cairo-perf.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index f9faf3cc..ac14cf67 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -38,11 +38,7 @@ typedef struct _cairo_perf { unsigned int max_size; } cairo_perf_t; -cairo_perf_t perfs[] = { - { "paint", paint, 32, 1024 }, - { "paint_alpha", paint_alpha, 32, 1024 }, - { NULL } -}; +cairo_perf_t perfs[]; /* Some targets just aren't that interesting for performance testing, * (not least because many of these surface types use a meta-surface @@ -88,6 +84,7 @@ main (int argc, char *argv[]) cairo_surface_t *surface; cairo_t *cr; unsigned int size; + double rate; if (getenv("CAIRO_PERF_DURATION")) cairo_perf_duration = strtol(getenv("CAIRO_PERF_DURATION"), NULL, 0); @@ -104,7 +101,11 @@ main (int argc, char *argv[]) size, size, &target->closure); cr = cairo_create (surface); - perf->run (cr, size, size); + rate = perf->run (cr, size, size); + if (perf->min_size == perf->max_size) + printf ("%s\t%s\t%g\n", target->name, perf->name, rate); + else + printf ("%s\t%s-%d\t%g\n", target->name, perf->name, size, rate); } } } @@ -112,3 +113,8 @@ main (int argc, char *argv[]) return 0; } +cairo_perf_t perfs[] = { + { "paint", paint, 32, 1024 }, + { "paint_alpha", paint_alpha, 32, 1024 }, + { NULL } +}; |