]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Delete benchmark code attempting to measure function call overhead.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 2 Jun 2020 05:27:59 +0000 (07:27 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 2 Jun 2020 05:27:59 +0000 (07:27 +0200)
ChangeLog
examples/nettle-benchmark.c

index 16fcb4672aa3b12c4d7af2b7c613368737aad692..1cf3e94038daf4cdcf17bbf46b6ab306bc818397 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-06-02  Niels Möller  <nisse@lysator.liu.se>
+
+       * 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  <nisse@lysator.liu.se>
 
        * Released Nettle-3.6.
index 5d0e649ea72620934f7d3d3ad7c2adcaf839c2d2..69e34bfd7c9eb74ba29dd1c76e94be79da9af285 100644 (file)
@@ -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();