google / google/benchmark

[FR] Easy attaching perf from within the library

Open
#1,889 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

**Is your feature request related to a problem? Please describe.**

Sometimes benchmarks have a heavy setup which affects counters/recordings.
It would be nice to easily skip heavy initialization when using perf.

**Describe the solution you'd like**

folly benchmarks has `--bm_perf_args` which will start perf after doing a first iteration of a benchmark.
Running the first iteration of the benchmark allows to skip initialization of statics.

For example in folly benchmarks I can run `--bm_perf_args=record` or `--bm_perf_args=stat`.

That works ok but isn't very generic. Maybe you know something more generic?

**Describe alternatives you've considered**
It is possible to do this through external tools but is very annoying.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.