diff options
author | Burt P <pburt0@gmail.com> | 2017-12-22 16:08:16 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-02-27 07:41:51 -0800 |
commit | 01235e2d08090641b2c9c4d8344223f84f5b608d (patch) | |
tree | de48511695527dd686f75c187820540d7c4dd282 /includes | |
parent | 45bf74abab1b665143acbcd3d44e05793dd1b32d (diff) |
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 <pburt0@gmail.com>
Diffstat (limited to 'includes')
-rw-r--r-- | includes/benchmark.h | 5 |
1 files changed, 5 insertions, 0 deletions
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__ */ |