• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

google / benchmark / 1124
92%

Build:
DEFAULT BRANCH: master
Ran 10 Oct 2017 03:59PM UTC
Jobs 1
Files 35
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1124

push

travis-ci

dominichamon
Add C++11 Ranged For loop alternative to KeepRunning (#454)

* Add C++11 Ranged For loop alternative to KeepRunning

As pointed out by @astrelni and @dominichamon, the KeepRunning
loop requires a bunch of memory loads and stores every iterations,
which affects the measurements.

The main reason for these additional loads and stores is that the
State object is passed in by reference, making its contents externally
visible memory, and the compiler doesn't know it hasn't been changed
by non-visible code.

It's also possible the large size of the State struct is hindering
optimizations.

This patch allows the `State` object to be iterated over using
a range-based for loop. Example:

void BM_Foo(benchmark::State& state) {
	for (auto _ : state) {
		[...]
	}
}

This formulation is much more efficient, because the variable counting
the loop index is stored in the iterator produced by `State::begin()`,
which itself is stored in function-local memory and therefore not accessible
by code outside of the function. Therefore the compiler knows the iterator
hasn't been changed every iteration.

This initial patch and idea was from Alex Strelnikov.

* Fix null pointer initialization in C++03

1415 of 1624 relevant lines covered (87.13%)

3722862.91 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1124.1 (COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage) 10 Oct 2017 03:59PM UTC 0
87.13
Travis Job 1124.1
Source Files on build 1124
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1124
  • 05267559 on github
  • Prev Build on master (#1108)
  • Next Build on master (#1139)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc