diff options
| author | Martin Hořeňovský | 2023-01-28 21:40:51 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-01-28 21:40:59 +0100 |
| commit | 356dfc14391183aef80af7f23fe2297485311ae4 (patch) | |
| tree | 85eb602d0711f63295abfba4de1b15e051534522 /src/catch2/benchmark | |
| parent | e5d1eb757fe399ff312d837a318dcf17b495d32e (diff) | |
| download | catch3-356dfc14391183aef80af7f23fe2297485311ae4.tar.gz | |
Move name and sample analysis in benchmarks into BenchmarkStats
This always saves 1 allocation per benchmark, and another two
allocations if the benchmark name is longer than the SSO buffer.
Diffstat (limited to 'src/catch2/benchmark')
| -rw-r--r-- | src/catch2/benchmark/catch_benchmark.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/benchmark/catch_benchmark.hpp b/src/catch2/benchmark/catch_benchmark.hpp index a2d5c3ea..1cf10be6 100644 --- a/src/catch2/benchmark/catch_benchmark.hpp +++ b/src/catch2/benchmark/catch_benchmark.hpp @@ -64,7 +64,7 @@ namespace Catch { }); BenchmarkInfo info { - name, + CATCH_MOVE(name), plan.estimated_duration.count(), plan.iterations_per_sample, cfg->benchmarkSamples(), @@ -80,7 +80,7 @@ namespace Catch { }); auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end()); - BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance }; + BenchmarkStats<FloatDuration<Clock>> stats{ CATCH_MOVE(info), CATCH_MOVE(analysis.samples), analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance }; getResultCapture().benchmarkEnded(stats); } CATCH_CATCH_ANON (TestFailureException) { getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr); |