[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] bench: use a C++-11 compiler
From: |
Akim Demaille |
Subject: |
[PATCH 2/6] bench: use a C++-11 compiler |
Date: |
Sun, 22 Mar 2020 16:02:07 +0100 |
See https://github.com/google/benchmark#a-faster-keeprunning-loop.
* etc/bench.pl.in ($cxx): Be C++11.
(&bench_with_gbenchmark): Adjust.
---
etc/bench.pl.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index e067d870..c65efd85 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -148,7 +148,7 @@ The C compiler.
=item C<$cxx>
-The C++ compiler.
+The C++-11 compiler.
=item C<$cflags>
@@ -173,7 +173,7 @@ Verbosity level.
my $bench;
my $bison = $ENV{'BISON'} || '@abs_top_builddir@/tests/bison';
my $cc = $ENV{'CC'} || 'gcc';
-my $cxx = $ENV{'CXX'} || 'g++';
+my $cxx = $ENV{'CXX'} || 'g++ -std=c++11';
my $cflags = '-O2';
my @directive = ();
my $gbench = 0;
@@ -579,7 +579,7 @@ static void BM_${prefix} (benchmark::State& state)
exit (3);
}
- while (state.KeepRunning())
+ for (auto _ : state)
{
rewind (input);
${prefix}parse ();
--
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, 2020/03/22
- [PATCH 2/6] bench: use a C++-11 compiler,
Akim Demaille <=
- [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