google / google/benchmark

[FR] Executing benchmarks in parallel on pinned cores

Open
#964 2 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.**
I have a lot of microbenchmarks - total runtime > 5 hours. All of the benchmarks are quite small (< 10k worth of data, no threading). Currently, I run all of the benchmarks on one core, one after another. Theoretically, if one was to bind one benchmark to one core (not hyper thread but core), they could've ran in parallel without affecting overall results.

**Describe the solution you'd like**
Provide an option, for example: `--scedule-benchmarks-on-n-cores=`. This would run the separately, on each core. Would need to probably forbid requesting all cores and more cores than one has. There are a few issues here, like dealing with relative cpu frequencies or different cores having different characteristics. I don't know enough about this but seems like it should be solvable.

**Describe alternatives you've considered**
Alternative would be to have a wrapping script that would deal with filtering/pinning processes. This is also a way to go, but if this were to be in the library, everybody could comfortably use it.

**Additional context**
This is a big ask, and you'd know better if this is beneficial to a sufficient number of your users to implement.
Also - if you have somewhere a script that does it on linux already, I would really appreciate it, I doubt that I'm the first person that needs this.

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.