From 0cc5bead400aadfe9c5e4b3dfb9f70ee7e31e833 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 17 Jul 2008 16:06:20 +0200 Subject: [PATCH] bench: Improve output. * etc/bench.pl.in (bench_grammar): Tune the printf format. --- ChangeLog | 5 +++++ etc/bench.pl.in | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a52e0535..a0e483ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-03 Akim Demaille + + bench: Improve output. + * etc/bench.pl.in (bench_grammar): Tune the printf format. + 2008-11-03 Akim Demaille bench: check impact of %debug on variants. diff --git a/etc/bench.pl.in b/etc/bench.pl.in index 481f3dda..eadfa4b3 100755 --- a/etc/bench.pl.in +++ b/etc/bench.pl.in @@ -696,9 +696,15 @@ sub bench_grammar ($%) # Display the sizes. print "Sizes:\n"; + my $width = 10; for my $bench (keys %size) { - printf "%10s: %10dkB\n", $bench, int ($size{$bench} / 1024); + $width = length $bench + if $width < length $bench; + } + for my $bench (keys %size) + { + printf "%${width}s: %5dkB\n", $bench, int ($size{$bench} / 1024); } } -- 2.50.0