From 2948ccf470980c6796c00f95e901b95113b663a4 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Fri, 8 Nov 2013 11:17:40 -0800 Subject: Discard the first run, to avoid any cache filling effects I don't know that this is strictly required, but the Cairo performance tests do it, so why not. --- src/caskbench.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/caskbench.cpp') diff --git a/src/caskbench.cpp b/src/caskbench.cpp index 2d24144..2f96d0f 100644 --- a/src/caskbench.cpp +++ b/src/caskbench.cpp @@ -47,7 +47,7 @@ caskbench_perf_test_t perf_tests[] = { {"skia-paint", sk_setup_paint, sk_teardown_paint, sk_test_paint}, {"skia-stroke", sk_setup_stroke, sk_teardown_stroke, sk_test_stroke}, }; -#define NUM_CASES (10) +#define NUM_CASES (sizeof(perf_tests)/sizeof(perf_tests[0])) typedef enum { CASKBENCH_STATUS_PASS, @@ -93,7 +93,7 @@ process_options(caskbench_options_t *opt, int argc, char *argv[]) // Initialize options opt->dry_run = 0; - opt->iterations = 16; + opt->iterations = 64; pc = poptGetContext(NULL, argc, (const char **)argv, po, 0); poptSetOtherOptionHelp(pc, "[ARG...]"); @@ -200,8 +200,10 @@ main (int argc, char *argv[]) goto FINAL; } - // TODO: Perhaps run once just to warm caches and calibrate - for (i=opt.iterations; i>=0; --i) { + // Run once to warm caches and calibrate + perf_tests[c].test_case(&context); + + for (i=opt.iterations; i>0; --i) { try { assert(perf_tests[c].test_case); start_time = get_tick(); -- cgit v1.3.1-4-g156e