Skip to content

feat: add support for fixtures#7

Merged
not-matthias merged 1 commit into
mainfrom
cod-668-support-fixtures-in-google-benchmark
Mar 17, 2025
Merged

feat: add support for fixtures#7
not-matthias merged 1 commit into
mainfrom
cod-668-support-fixtures-in-google-benchmark

Conversation

@not-matthias

@not-matthias not-matthias commented Mar 14, 2025

Copy link
Copy Markdown
Member

Normal output:

MyFixture/FooTest                                   0.000 ns        0.000 ns   1000000000000
MyFixture/BarTest                                   0.000 ns        0.000 ns   1000000000000
MyTemplatedFixture<int>/IntTest                     0.000 ns        0.000 ns   1000000000000
MyTemplatedFixture<double>/DoubleTest               0.000 ns        0.000 ns   1000000000000
MyTemplate1<int>/TestA                              0.000 ns        0.000 ns   1000000000000
MyTemplate2<int,double>/TestB                       0.000 ns        0.000 ns   1000000000000

Output with instrumentation enabled:

Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyFixture[FooTest]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyFixture[BarTest]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplatedFixture[IntTest, int]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplatedFixture[DoubleTest, double]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplate1[TestA, int]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplate2[TestB, int, double]

Minor detail: Should the format be MyFixture[TestA] or TestA[MyFixture]. Both make sense imo.

@codspeed-hq

codspeed-hq Bot commented Mar 14, 2025

Copy link
Copy Markdown

CodSpeed Instrumentation Performance Report

Merging #7 will not alter performance

Comparing cod-668-support-fixtures-in-google-benchmark (772a2db) with main (1dda619)

Summary

✅ 15 untouched benchmarks
🆕 6 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 BarTest[MyFixture] N/A 6.2 µs N/A
🆕 DoubleTest[MyTemplatedFixture, double] N/A 6.3 µs N/A
🆕 FooTest[MyFixture] N/A 6.3 µs N/A
🆕 IntTest[MyTemplatedFixture, int] N/A 6.3 µs N/A
🆕 TestA[MyTemplate1, int] N/A 6.3 µs N/A
🆕 TestB[MyTemplate2, int, double] N/A 6.3 µs N/A

@codspeed-hq

codspeed-hq Bot commented Mar 14, 2025

Copy link
Copy Markdown

CodSpeed Walltime Performance Report

Merging #7 will not alter performance

Comparing cod-668-support-fixtures-in-google-benchmark (772a2db) with main (1dda619)

Summary

✅ 15 untouched benchmarks
🆕 6 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 BarTest[MyFixture] N/A 3.6 ns N/A
🆕 DoubleTest[MyTemplatedFixture, double] N/A 3.8 ns N/A
🆕 FooTest[MyFixture] N/A 3.8 ns N/A
🆕 IntTest[MyTemplatedFixture, int] N/A 3.7 ns N/A
🆕 TestA[MyTemplate1, int] N/A 3.8 ns N/A
🆕 TestB[MyTemplate2, int, double] N/A 3.6 ns N/A

@GuillaumeLagrange GuillaumeLagrange left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

olgtm, let's go with test[fixture] as discussed in person

Comment thread examples/google_benchmark/fixture_bench.hpp Outdated
Comment thread google_benchmark/include/benchmark/benchmark.h Outdated
@not-matthias
not-matthias force-pushed the cod-668-support-fixtures-in-google-benchmark branch from 0e0dd66 to 772a2db Compare March 14, 2025 17:10

@GuillaumeLagrange GuillaumeLagrange left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@not-matthias
not-matthias merged commit 772a2db into main Mar 17, 2025
@not-matthias
not-matthias deleted the cod-668-support-fixtures-in-google-benchmark branch March 17, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants