]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
pagealign_alloc: Tweak the benchmark.
authorBruno Haible <bruno@clisp.org>
Fri, 12 Sep 2025 23:46:42 +0000 (01:46 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 12 Sep 2025 23:47:05 +0000 (01:47 +0200)
* tests/bench-pagealign_alloc.c (show_stats): Reformat.
(main): Fix usage message.

ChangeLog
tests/bench-pagealign_alloc.c

index 209e6b08eb83486a366466d2460978d202bf0022..9b45e80a86d1456f3886e5ed26783b64e87037ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-09-12  Bruno Haible  <bruno@clisp.org>
+
+       pagealign_alloc: Tweak the benchmark.
+       * tests/bench-pagealign_alloc.c (show_stats): Reformat.
+       (main): Fix usage message.
+
 2025-09-12  Bruno Haible  <bruno@clisp.org>
 
        vma-iter: Improve on OpenBSD.
index bdba5bfecf2d9f5697b27565a542006fa24bd9bc..3366fd100d9dddde2f66ba32f2bb222611f150d4 100644 (file)
@@ -67,11 +67,15 @@ show_stats (intptr_t initial_as, intptr_t initial_data, int count)
       intptr_t requested = count * size_of_some_pages ();
       intptr_t as_increase = get_rusage_as () - initial_as;
       intptr_t data_increase = get_rusage_data () - initial_data;
-      printf ("count = %5d: requested: %6ld pages, allocated AS: %6ld pages (%.2f%%), allocated DATA: %6ld pages (%.2f%%)\n",
+      printf ("count = %5d: requested: %6ld pages, "
+              "allocated AS: %6ld pages (%.2f%%), "
+              "allocated DATA: %6ld pages (%.2f%%)\n",
               count,
               (long int) (requested / pagesize),
-              (long int) (as_increase / pagesize), 100 * (double) as_increase / (double) requested,
-              (long int) (data_increase / pagesize), 100 * (double) data_increase / (double) requested);
+              (long int) (as_increase / pagesize),
+              100 * (double) as_increase / (double) requested,
+              (long int) (data_increase / pagesize),
+              100 * (double) data_increase / (double) requested);
     }
 }
 
@@ -99,7 +103,7 @@ main (int argc, char *argv[])
   if (argc != 2)
     {
       fprintf (stderr, "Usage: %s TESTS\n", argv[0]);
-      fprintf (stderr, "Example: %s abcdef\n", argv[0]);
+      fprintf (stderr, "Example: %s {a|b|c|d|e|f}\n", argv[0]);
       exit (1);
     }