From: Akim Demaille Date: Thu, 17 Jul 2008 14:06:20 +0000 (+0200) Subject: bench: Improve output. X-Git-Tag: v2.7.90~1173 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/0cc5bead400aadfe9c5e4b3dfb9f70ee7e31e833 bench: Improve output. * etc/bench.pl.in (bench_grammar): Tune the printf format. --- 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); } }