From: Niels Möller Date: Tue, 2 Jun 2020 05:27:59 +0000 (+0200) Subject: Delete benchmark code attempting to measure function call overhead. X-Git-Tag: nettle_3.7rc1~111 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d420aa762c4eb64fcd9b89096f2e7312090f8fac;p=thirdparty%2Fnettle.git Delete benchmark code attempting to measure function call overhead. --- 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();