From d420aa762c4eb64fcd9b89096f2e7312090f8fac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niels=20M=C3=B6ller?= Date: Tue, 2 Jun 2020 07:27:59 +0200 Subject: [PATCH] Delete benchmark code attempting to measure function call overhead. --- ChangeLog | 8 ++++++++ examples/nettle-benchmark.c | 18 ------------------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16fcb467..1cf3e940 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-06-02 Niels Möller + + * examples/nettle-benchmark.c (main): Delete call to + time_overhead. The attempt to measure function call overhead is + not very useful or accurate. The benchmarking loop is optimized + away by gcc-10, making the benchmark program hang. + (bench_nothing, time_overhead): Deleted. + 2020-04-29 Niels Möller * Released Nettle-3.6. diff --git a/examples/nettle-benchmark.c b/examples/nettle-benchmark.c index 5d0e649e..69e34bfd 100644 --- a/examples/nettle-benchmark.c +++ b/examples/nettle-benchmark.c @@ -152,12 +152,6 @@ time_function(void (*f)(void *arg), void *arg) return elapsed / ncalls - overhead; } -static void -bench_nothing(void *arg UNUSED) -{ - return; -} - struct bench_memxor_info { void *dst; @@ -333,17 +327,6 @@ xalloc(size_t size) return p; } -static void -time_overhead(void) -{ - overhead = time_function(bench_nothing, NULL); - printf("benchmark call overhead: %7f us", overhead * 1e6); - if (frequency > 0.0) - printf("%7.2f cycles\n", overhead * frequency); - printf("\n"); -} - - static void time_memxor(void) @@ -991,7 +974,6 @@ main(int argc, char **argv) bench_salsa20_core(); bench_sha3_permute(); printf("\n"); - time_overhead(); header(); -- 2.47.2