diff options
author | Akim Demaille <demaille@gostai.com> | 2008-07-22 09:33:34 +0200 |
---|---|---|
committer | Akim Demaille <demaille@gostai.com> | 2008-11-04 21:43:32 +0100 |
commit | cac9e09bbf68269173df301cd06ad40b904d11ec (patch) | |
tree | fefe956cd8ef879940a0f360c11c9632731ff981 /etc/bench.pl.in | |
parent | 4af4348a3f5f6b5c4e537edd09f5fe9cf30e9eb6 (diff) | |
download | bison-cac9e09bbf68269173df301cd06ad40b904d11ec.tar.gz |
Improve the display of sizes.
* etc/bench.p.in: Higher precision.
Sort by decreasing size.
Diffstat (limited to 'etc/bench.pl.in')
-rwxr-xr-x | etc/bench.pl.in | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/bench.pl.in b/etc/bench.pl.in index 93f3d176..d1b2aa44 100755 --- a/etc/bench.pl.in +++ b/etc/bench.pl.in @@ -725,16 +725,18 @@ sub bench_grammar ($%) cmpthese ($res, 'nop'); # Display the sizes. - print "Sizes:\n"; + print "Sizes (decreasing):\n"; my $width = 10; for my $bench (keys %size) { $width = length $bench if $width < length $bench; } - for my $bench (keys %size) + # Benches sorted by decreasing size. + my @benches_per_size = sort {$size{$b} <=> $size{$a}} keys %size; + for my $bench (@benches_per_size) { - printf "%${width}s: %5dkB\n", $bench, int ($size{$bench} / 1024); + printf "%${width}s: %5.2fkB\n", $bench, $size{$bench} / 1024; } } |