third_party_benchmark/cmake
Eric 207b9c7aec
Improve State packing: put important members on first cache line. (#527)
* Improve State packing: put important members on first cache line.

This patch does a few different things to ensure commonly accessed
data is on the first cache line of the `State` object.

First, it moves the `error_occurred_` member to reside after
the `started_` and `finished_` bools, since there was internal
padding there that was unused.

Second, it moves `batch_leftover_` and `max_iterations` further up
in the struct declaration. These variables are used in the calculation
of `iterations()` which users might call within the loop. Therefore
it's more important they exist on the first cache line.

Finally, this patch turns the bool members into bitfields. Although
this shouldn't have much of an effect currently, because padding is
still needed between the last bool and the first size_t, it should
help in future changes that require more "bool like" members.

* Remove bitfield change for now

* Move bools (and their padding) to end of "first cache line" vars.

I think it makes the most sense to move the padding required
following the group of bools to the end of the variables we want
on the first cache line.

This also means that the `total_iterations_` variable, which is the
most accessed, has the same address as the State object.

* Fix static assertion after moving bools
2018-02-14 13:44:41 -07:00
..
Modules CMake: implement LTO for clang. Fixes #478 (#487) 2017-11-29 12:48:43 -08:00
AddCXXCompilerFlag.cmake Improve State packing: put important members on first cache line. (#527) 2018-02-14 13:44:41 -07:00
benchmark.pc.in Add a pkg-config file, for the benefit of projects not using CMake. (#480) 2017-11-15 11:51:22 -08:00
Config.cmake.in Add CMake Package Config files during install 2017-04-03 01:54:24 +02:00
CXXFeatureCheck.cmake Attempting to resolve a submoduling issues... (#439) 2017-08-28 16:10:19 -07:00
GetGitVersion.cmake Fix get_git_version to use GIT_EXECUTABLE. 2015-10-18 02:13:37 +02:00
gnu_posix_regex.cpp Fix #50 by using nullptr and adding stricter warning. 2014-10-11 15:52:50 -07:00
HandleGTest.cmake Fix GTest workaround on MSVC 2018-02-12 18:43:32 -07:00
llvm-toolchain.cmake CMake: implement LTO for clang. Fixes #478 (#487) 2017-11-29 12:48:43 -08:00
posix_regex.cpp Close a memory leak in configuration code 2016-02-09 13:08:56 +00:00
std_regex.cpp Change std::regex detection test to detect bug in libstdc++. 2015-03-06 12:05:19 -05:00
steady_clock.cpp address review comments 2015-03-26 18:32:31 -04:00
thread_safety_attributes.cpp Adopt new benchmark timing internals. 2015-03-12 18:03:33 -04:00