-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Refactoring of PerfCounters infrastructure #1559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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: - Added BENCHMARK_DONT_OPTIMIZE macro in global scope - Removal of the `IsValid()` query, being replaced by checking the number of remaining counters after validity tests - Refactoring of all GTests to reflect the changes and new semantics - extra comments throughout the new code to clarify intent It was extremely hard to separate all those features in different PRs as requested since they are so interdependent on each other so I'm just pushing them altogether and asking for forgiveness. This PR comes replacing PRs 1555 and 1558 which have been closed.
My clang-format insists in deleting this single white space on line 601 while Github's clang format breaks when it is added. I had to disable format-on-save to check-in this revert change. I'm using clang 14.0.6.
|
The Bazel failures dont seem related to code. What to do? |
|
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. |
|
lgtm, some nits |
Maybe because some tests are now running in full while before they were being collapsed by the compiler? |
|
thanks for all the iterations :D |
| reports_for_family = &per_family_reports[benchmark.family_index()]; | ||
|
|
||
| runners.emplace_back(benchmark, reports_for_family); | ||
| benchmarks_with_threads += (benchmark.threads() > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is always true. Should it be threads() > 1?
Change condition for `benchmarks_with_threads` from `benchmark.threads() > 0` to `> 1`. `threads()` appears to always be `>= 1`. Introduced in fbc6efa (Refactoring of PerfCounters infrastructure (google#1559))
Change condition for `benchmarks_with_threads` from `benchmark.threads() > 0` to `> 1`. `threads()` appears to always be `>= 1`. Introduced in fbc6efa (Refactoring of PerfCounters infrastructure (google#1559))
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:
IsValid()query, being replaced by checking the number of remaining counters after validity testsIt 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.