summaryrefslogtreecommitdiff
path: root/perf/subimage_copy.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-08-03 22:23:19 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-06 10:15:40 +0100
commit0db9e010fa70c65451d324cc9c0ade989f77fedd (patch)
treee249038d900a7afd7e3ede351517b74fd4be5764 /perf/subimage_copy.c
parent60c574ad062f3d8526056942bb7c9e71610a2773 (diff)
downloadcairo-0db9e010fa70c65451d324cc9c0ade989f77fedd.tar.gz
[perf] Calibrate tests to run for at least 2 seconds
By ensuring that tests take longer than a couple of seconds we eliminate systematic errors in our measurements. However, we also effectively eliminate the synchronisation overhead. To compensate, we attempt to estimate the overhead by reporting the difference between a single instance and the minimum averaged instance.
Diffstat (limited to 'perf/subimage_copy.c')
-rw-r--r--perf/subimage_copy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/perf/subimage_copy.c b/perf/subimage_copy.c
index 25b16cc2c..9bec2fb01 100644
--- a/perf/subimage_copy.c
+++ b/perf/subimage_copy.c
@@ -35,17 +35,20 @@
*/
static cairo_perf_ticks_t
-do_subimage_copy (cairo_t *cr, int width, int height)
+do_subimage_copy (cairo_t *cr, int width, int height, int loops)
{
cairo_rectangle (cr, 2, 2, 4, 4);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_perf_timer_start ();
- cairo_fill (cr);
+ while (loops--)
+ cairo_fill_preserve (cr);
cairo_perf_timer_stop ();
+ cairo_new_path (cr);
+
return cairo_perf_timer_elapsed ();
}