Questions tagged [google-benchmark]
84 questions
0
votes
0 answers
Core dump while spawning/joining threads inside Google benchmark test
I am getting core dump while trying to spawn and then join the threads inside google benchmark. This is irrespective of the number of threads I try to create.
Code to reproduce the issue:
void BM_ThreadsTest(benchmark::State &state)
{
…

LKB
- 127
- 2
- 8
0
votes
0 answers
Can I include libraries when benchmarking in quick-bench.com?
You know compiler explorer, cppinsights, quick bench, and build bench all link to each other, so I was wondering whether I can load libraries (such as Boost and Range-v3) in quick-bench as I do in compiler explorer.
Certainly there's not a…

Enlico
- 23,259
- 6
- 48
- 102
0
votes
1 answer
Naming Google Benchmark values
I feel like I'm missing something obvious, but, is there a way to name Google Benchmark argument values?
---------------- ----------
Benchmark Benchmark
---------------- ----------
NameTest/Alex …

Don Reba
- 13,814
- 3
- 48
- 61
0
votes
0 answers
Google benchmarks - Setting properties inside the constructor/ `SetUp` method
Hi I am trying to set the following Google Benchmark fixture property in the class. But it seems like the property is not getting set correctly.
Ex:
class Foo : public benchmark::Fixture {
Foo(){
this->Iterations(10);
}
// or
void…

n1r44
- 581
- 1
- 4
- 12
0
votes
0 answers
Google benchmark: flush the cache for every function call without timing it
I'm using Google benchmark to time a function, but I need to see how it performs when working with a "cold" cache. I know the benchmark library will run a function until the timing is steady, but I would like this steady timing to incorporate the…

rcplusplus
- 2,767
- 5
- 29
- 43
0
votes
0 answers
Why are the relative performance results in Google Benchmark completely different from raw loops?
I used Google Benchmark in the following way:
struct MyFixture : public benchmark::Fixture {
void SetUp(const ::benchmark::State& state) {
// do setup
}
void TearDown(const ::benchmark::State& state) {
…

Chou Tan
- 85
- 6
0
votes
0 answers
Flushing cache with Google Benchmark
I want to compare the performance of two algorithms on a large inputs. The primary difference between the algorithms is that one should have better cache access patterns than the other. I want the size of the input to be much larger than the L3…

Mark Wallace
- 528
- 2
- 12
0
votes
2 answers
Performance differences in Eigen between auto and Eigen::Ref and concrete type
I am trying to understand how Eigen::Ref works to see if I can take some advantage of it in my code.
I have designed a benchmark like this
static void value(benchmark::State &state) {
for (auto _ : state) {
const Eigen::Matrix

jjcasmar
- 1,387
- 1
- 18
- 30
0
votes
1 answer
In google benchmark, what is the meaning of Iterms_per_seconds and Why we need fixture?
In google benchmark:
there is a Iterms_per_seconds result and we can use the fixture way to test the bench.
What is the meaning of Iterms_per_seconds in google bench? Is it stands the throuput?
Why need the fixture to test benchmark? In this way…

user19327931
- 3
- 1
0
votes
1 answer
Globally set time unit and use wall-clock time when using google benchmark library?
I'm using google benchmark library for my own program time cost measuring.
I found my program time cost is milliseconds level, but benchmark's default time unit is nanosecond.
Also, many of them are with multi-thread inside so I prefer real-time…

ChrisZZ
- 1,521
- 2
- 17
- 24
0
votes
1 answer
How to pause the timer when benchmarking an already multithreaded function in google benchmark?
The documentation on GitHub has a section on multithreaded benchmarks, however, it requires placing the multithreaded code inside the benchmark definition, and the library would invoke this code with multiple threads itself.
I want to benchmark a…

murfel
- 157
- 2
- 7
0
votes
1 answer
Google Benchmark BaseClass Initialization happens before static variable assignment causes problem
I want to use google benchmark to run my codes, which contains a static global variable. In the benchmark's base class, I need to read this variable to perform some setup. But when the benchmark base class is initialized, that static variable is not…

Harper
- 1,794
- 14
- 31
0
votes
0 answers
Same function, different performance results by using Google benchmark
I was trying to familiarize myself with the google benchmark framework, and decided to run a test with the famous pre/post increments. However, I found out that within the execution of the same function, it is literally the same code, I get…

Berthin
- 189
- 2
- 12
0
votes
1 answer
Link Google benchmark with cmake
I try to compile my project including google benchmark. This is the project structure:
$proj:
|_ benchmark
|_ include
|_ src
|_ CMakeLists.txt
Into the folder include I add google benchmark as submodule linked to the latest release @73d4d5e.…

th3g3ntl3man
- 1,926
- 5
- 29
- 50
0
votes
2 answers
How can I tell Google Benchmark to not benchmark a line of code?
I am using Google Benchmark to benchmark a library. I have the benchmark set up as follows:
for (auto _ : state) {
run_function(first, last, v);
}
What I would like is for v to be randomly generated every iteration so that I could get a range…

Throckmorton
- 564
- 4
- 17