Skip to content

Conversation

@not-matthias
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to allow setting custom benchmark names in Google Benchmark while preserving file path and namespace prefixes when CODSPEED_ENABLED is defined. The implementation handles parameter preservation in the benchmark naming format.

Key changes:

  • Modified SetName() to intelligently preserve file/namespace prefixes and parameters
  • Added comprehensive test cases demonstrating custom naming with various scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
google_benchmark/src/benchmark_register.cc Updated SetName() method to preserve file path, namespace prefix, and parameters when CODSPEED_ENABLED
examples/google_benchmark_cmake/main.cpp Added test cases for custom benchmark naming including nested namespaces, captured benchmarks, and parameterized benchmarks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@not-matthias not-matthias force-pushed the cod-1575-codspeed-cpp-support-custom-benchmark-name branch from 1383fa0 to 3c5fc6b Compare October 28, 2025 13:33
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 28, 2025

CodSpeed Performance Report

Merging #31 will degrade performances by 32.21%

Comparing cod-1575-codspeed-cpp-support-custom-benchmark-name (cf778ec) with main (810d6b4)

Summary

⚡ 5 improvements
❌ 10 regressions
✅ 137 untouched
🆕 48 new

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
Simulation BM_Capture[int_string_test] 61.4 ns 90.6 ns -32.21%
Simulation BM_Capture[int_test] 61.4 ns 90.6 ns -32.21%
🆕 WallTime BM_Capture_int[int_test] N/A < 1 ns N/A
🆕 Simulation BM_Capture_int[int_test] N/A 90.6 ns N/A
🆕 Simulation BM_Capture_int_string[int_string_test] N/A 90.6 ns N/A
🆕 WallTime BM_Capture_int_string[int_string_test] N/A < 1 ns N/A
🆕 WallTime BM_custom_args[1000] N/A 1.3 ns N/A
🆕 Simulation BM_custom_args[1000] N/A 121.4 ns N/A
🆕 Simulation BM_custom_args[100] N/A 121.4 ns N/A
🆕 WallTime BM_custom_args[100] N/A 1.3 ns N/A
🆕 Simulation BM_custom_multi[10/20] N/A 153.3 ns N/A
🆕 WallTime BM_custom_multi[10/20] N/A 1.7 ns N/A
🆕 Simulation BM_custom_multi[100/200] N/A 153.3 ns N/A
🆕 WallTime BM_custom_multi[100/200] N/A 1.7 ns N/A
🆕 WallTime BM_short_name N/A < 1 ns N/A
🆕 Simulation BM_short_name N/A 61.7 ns N/A
🆕 Simulation BM_with_args[1000] N/A 121.4 ns N/A
🆕 WallTime BM_with_args[1000] N/A 1.3 ns N/A
🆕 Simulation BM_with_args[100] N/A 121.4 ns N/A
🆕 WallTime BM_with_args[100] N/A 1.3 ns N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

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

olgtm

@not-matthias not-matthias force-pushed the cod-1575-codspeed-cpp-support-custom-benchmark-name branch 2 times, most recently from 0b8e25e to a34fdd1 Compare October 29, 2025 09:39
Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

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

lgtm!

@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1575-codspeed-cpp-support-custom-benchmark-name branch from a34fdd1 to cf778ec Compare October 30, 2025 16:09
@GuillaumeLagrange GuillaumeLagrange merged commit cf778ec into main Oct 30, 2025
24 of 25 checks passed
@GuillaumeLagrange GuillaumeLagrange deleted the cod-1575-codspeed-cpp-support-custom-benchmark-name branch October 30, 2025 16:28
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.

3 participants