benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Align benchmark::State to a cacheline.

Open ckennelly opened this issue 3 years ago • 4 comments

This can avoid interference with neighboring objects and stabilize benchmark results.

ckennelly avatar Sep 17 '21 18:09 ckennelly

@dominichamon Another reason to have absl dependency :) Would make this PR so much simpler.

oontvoo avatar Sep 17 '21 18:09 oontvoo

do you have the results from a run with and without this change?

dmah42 avatar Sep 17 '21 20:09 dmah42

@dominichamon I only have an internal microbenchmark, which demonstrated higher variability across runs (especially when combined with a change to TCMalloc) without the alignment attribute.

ckennelly avatar Sep 17 '21 22:09 ckennelly

This seems plausible (although hard to tell without a test), but is this only about the State? What about ThreadTimer, ThreadManager, PerfCountersMeasurement?

LebedevRI avatar Sep 17 '21 22:09 LebedevRI