From 01235e2d08090641b2c9c4d8344223f84f5b608d Mon Sep 17 00:00:00 2001 From: Burt P Date: Fri, 22 Dec 2017 16:08:16 -0600 Subject: benchmark: New benchmark types New benchmark types: * benchmark_crunch_for(): call function repeatedly for a number of seconds; result is number of completions. * benchmark_parallel(): one call for each available thread up to n_threads; result is sum of return values. Tweaks: * Store return values from callback via benchmark_parallel_for_dispatcher() Signed-off-by: Burt P --- includes/benchmark.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'includes') diff --git a/includes/benchmark.h b/includes/benchmark.h index 975b7197..fa4ad0cf 100644 --- a/includes/benchmark.h +++ b/includes/benchmark.h @@ -41,6 +41,11 @@ bench_value bench_value_from_str(const char* str); bench_value benchmark_parallel_for(gint n_threads, guint start, guint end, gpointer callback, gpointer callback_data); +bench_value benchmark_parallel(gint n_threads, gpointer callback, gpointer callback_data); + +bench_value benchmark_crunch_for(float seconds, gint n_threads, + gpointer callback, gpointer callback_data); + extern bench_value bench_results[BENCHMARK_N_ENTRIES]; #endif /* __BENCHMARK_H__ */ -- cgit v1.2.3