summaryrefslogtreecommitdiff
path: root/perf/paint.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-09-06 00:53:52 -0700
committerCarl Worth <cworth@cworth.org>2006-09-06 00:53:52 -0700
commit3c407aa80a43e1724e732482ada5ad6718fe33ae (patch)
tree5ad90a587e69726881488ced2dded32633c5de12 /perf/paint.c
parent3519887f1838a8ea67784eecec31feb9a37b4828 (diff)
perf-paint: Spend more iterations on smaller sizes to balance testing.
The values here are chosen to try to equalize the standard deviation of the various tests.
Diffstat (limited to 'perf/paint.c')
-rw-r--r--perf/paint.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/perf/paint.c b/perf/paint.c
index 22c518876..2501a33cf 100644
--- a/perf/paint.c
+++ b/perf/paint.c
@@ -25,14 +25,28 @@
#include "cairo-perf.h"
+static int
+iters_for_size (int size)
+{
+ if (size <= 64)
+ return 8;
+ else if (size <= 128)
+ return 4;
+ else if (size <= 256)
+ return 2;
+ else
+ return 1;
+}
+
static cairo_perf_ticks_t
-do_paint (cairo_t *cr)
+do_paint (cairo_t *cr, int size)
{
int i;
+ int iters = iters_for_size (size);
cairo_perf_timer_start ();
- for (i=0; i < 3; i++)
+ for (i=0; i < iters; i++)
cairo_paint (cr);
cairo_perf_timer_stop ();
@@ -45,7 +59,7 @@ paint (cairo_t *cr, int width, int height)
{
cairo_set_source_rgb (cr, 0.2, 0.6, 0.9);
- return do_paint (cr);
+ return do_paint (cr, width);
}
cairo_perf_ticks_t
@@ -53,6 +67,6 @@ paint_alpha (cairo_t *cr, int width, int height)
{
cairo_set_source_rgb (cr, 0.2, 0.6, 0.9);
- return do_paint (cr);
+ return do_paint (cr, width);
}