From 5e8871821eeebf8aad835891dc6744a59e65cd23 Mon Sep 17 00:00:00 2001 From: Karl Schultheisz Date: Tue, 30 May 2023 15:12:35 -0400 Subject: [PATCH] posix/benchmark: add benchmark_app_proc_play This differentiates it from benchmark_app_proc_idle, which is what the old benchmark did, so the old benchmark gets a new name. --- posix/benchmark/main.c | 16 ++++++++++++++-- posix/benchmark/meson.build | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/posix/benchmark/main.c b/posix/benchmark/main.c index dce65df..13fb902 100644 --- a/posix/benchmark/main.c +++ b/posix/benchmark/main.c @@ -5,7 +5,7 @@ #define run(fn) bm_run(#fn, fn) static void -benchmark_app_proc(uint32_t iterations) +benchmark_app_proc_idle(uint32_t iterations) { struct app app; app_init(&app); @@ -15,6 +15,17 @@ benchmark_app_proc(uint32_t iterations) } } +static void +benchmark_app_proc_play(uint32_t iterations) +{ + struct app app; + app_init(&app); + seq_start(&app.seq); + + for (uint32_t i = 0; i < iterations; i++) { + app_proc(&app); + } +} static float clock_now() { @@ -51,6 +62,7 @@ bm_run(const char *name, void (*func)(uint32_t iterations)) int main(void) { - run(benchmark_app_proc); + run(benchmark_app_proc_idle); + run(benchmark_app_proc_play); return 0; } diff --git a/posix/benchmark/meson.build b/posix/benchmark/meson.build index b3e2b0a..45577db 100644 --- a/posix/benchmark/meson.build +++ b/posix/benchmark/meson.build @@ -16,4 +16,4 @@ benchmark = executable( native: true, ) -benchmark('benchmark-pure', benchmark) +benchmark('benchmark-pure', benchmark, verbose: true) -- 2.38.5