Catch2: Benchmark manual samples and iterations count

Created on 2 Aug 2019  路  4Comments  路  Source: catchorg/Catch2

Currently, Catch2 Benchmark automatically compute the required iterations count for a benchmark to be accurate, and the sample count seems to be fixed to 100.

This is great. But in some cases, it would be very useful to be able to set this manually, especially the sample count. This is possible in Celero, and it would be great to have it too in Catch2.

Most helpful comment

It looks like the the sample count is already adjustable through the --benchmark-samples option, at least since Catch 2.9.0 I suppose. However, you're right that there is no such option for the iterations per sample, that could be added still.

All 4 comments

It looks like the the sample count is already adjustable through the --benchmark-samples option, at least since Catch 2.9.0 I suppose. However, you're right that there is no such option for the iterations per sample, that could be added still.

I didn't know that, thanks.

There should be a way to adjust the sample / iteration count automatically based on the estinated runtime. When I'm benchmarking insertion of 1000 items in my container I do want a large number of sample. When I'm inserting 10 million items and it takes 10 seconds for each sample, I don't want 100 samples.

Is it possible to define the benchmark samples in an other form then the --benchmark-samples? I would like to be able to define the samples per benchmark. But I don't know how.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qneverless picture qneverless  路  6Comments

jmeekhof picture jmeekhof  路  4Comments

johnthagen picture johnthagen  路  3Comments

Viatorus picture Viatorus  路  3Comments

Aivean picture Aivean  路  6Comments