google / benchmark

A microbenchmark support library
Apache License 2.0
8.69k stars 1.59k forks source link

Refactoring of PerfCounters infrastructure #1559

Closed HFTrader closed 1 year ago

HFTrader commented 1 year ago

The main feature in this pull request is the removal of the static sharing of PerfCounters and instead creating them at the top RunBenchmarks() function where all benchmark runners are created. A single PerfCountersMeasurement object is created and then shared with all the new BenchmarkRunners objects, one per existing benchmark.

Other features conflated here in this PR are:

It was truly impossible to separate all those features in different PRs as requested since they are so interdependent on each other so I'm just pushing them together and asking for forgiveness.

This PR comes replacing PRs 1555 and 1558 which have been closed.

HFTrader commented 1 year ago

The Bazel failures dont seem related to code. What to do?

dmah42 commented 1 year ago

rerunning the osx one, that looks like a local failure. the windows one seems like some timings changed away from expectations. that shouldn't be related to this PR. i'l try rerunning that too.

mtrofin commented 1 year ago

lgtm, some nits

HFTrader commented 1 year ago

rerunning the osx one, that looks like a local failure. the windows one seems like some timings changed away from expectations. that shouldn't be related to this PR. i'l try rerunning that too.

Maybe because some tests are now running in full while before they were being collapsed by the compiler?

dmah42 commented 1 year ago

thanks for all the iterations :D