[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] bench: use the same prefix in both bench methods
From: |
Akim Demaille |
Subject: |
[PATCH 3/6] bench: use the same prefix in both bench methods |
Date: |
Sun, 22 Mar 2020 16:02:08 +0100 |
* etc/bench.pl.in (&bench_with_timethese): Also use y$i, as in
&bench_with_gbenchmark.
(&generate_grammar_calc): Don't add a prefix, let the callers do it.
---
etc/bench.pl.in | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index c65efd85..d49742f1 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -372,7 +372,7 @@ sub generate_grammar_calc ($$@)
{
my ($base, $max, @directive) = @_;
- my $prefix = "y$base";
+ my $prefix = $base;
push @directive, "%define api.prefix {$prefix}"
if ($gbench);
my $directives = directives ($base, @directive);
@@ -899,13 +899,11 @@ sub bench_with_timethese ($@)
# Set up the benches as expected by timethese.
my %bench;
- # A counter of directive sets.
- my $count = 1;
- for my $d (@directive)
+ for my $i (0 .. $#directive)
{
- $bench{$count} = $d;
- printf " %2d. %s\n", $count, join (' ', split ("\n", $d));
- $count++;
+ my $base = "y$i";
+ $bench{$base} = $directive[$i];
+ printf " %2d. %s\n", $i, join (' ', split ("\n", $directive[$i]));
};
# For each bench, capture the size.
--
2.25.1
- [PATCH 0/6] Bench: improvements, Akim Demaille, 2020/03/22
- [PATCH 1/6] bench: create a README file with benches, Akim Demaille, 2020/03/22
- [PATCH 3/6] bench: use the same prefix in both bench methods,
Akim Demaille <=
- [PATCH 2/6] bench: use a C++-11 compiler, Akim Demaille, 2020/03/22
- [PATCH 4/6] bench: add a "latest" symlink, Akim Demaille, 2020/03/22
- [PATCH 6/6] bench: calc: no need for super long inputs, Akim Demaille, 2020/03/22
- [PATCH 5/6] bench: calc: work on a string instead of a file, Akim Demaille, 2020/03/22