Skip to content

Conversation

@not-matthias
Copy link
Member

@not-matthias not-matthias commented Jan 14, 2026

TODO: REmove the custom memtrack installation before merging

@not-matthias not-matthias changed the title chore: bump instrument-hooks to support memory profiling feat: add memory profiling support Jan 14, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 14, 2026

Merging this PR will degrade performance by 35.81%

⚡ 13 improved benchmarks
❌ 19 regressed benchmarks
✅ 160 untouched benchmarks
🆕 190 new benchmarks

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

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 WallTime BM_RLE_Encode_SmallRuns[100] N/A 1.8 µs N/A
🆕 WallTime BM_RLE_Encode_SmallRuns[100000] N/A 1.6 ms N/A
🆕 WallTime BM_RLE_Encode_SmallRuns[10000] N/A 151.5 µs N/A
🆕 WallTime BM_RLE_Encode_SmallRuns[1000] N/A 15.5 µs N/A
🆕 WallTime BM_RLE_Decode[100000] N/A 286.6 µs N/A
🆕 WallTime BM_RLE_Encode_LargeRuns[10000] N/A 20.5 µs N/A
🆕 WallTime BM_RLE_Decode[1000] N/A 2.7 µs N/A
🆕 WallTime BM_RLE_Decode[100] N/A 374.7 ns N/A
🆕 WallTime BM_RLE_Encode_LargeRuns[100] N/A 212.1 ns N/A
🆕 WallTime BM_Vector_PushBack[1000] N/A 3.7 µs N/A
🆕 WallTime BM_RLE_Encode_LargeRuns[1000] N/A 2.2 µs N/A
🆕 WallTime BM_RLE_Decode[10000] N/A 22.5 µs N/A
🆕 WallTime BM_Vector_PushBack[10] N/A 284.1 ns N/A
WallTime BM_StringCopy 11 ns 13.9 ns -20.74%
🆕 WallTime BM_Vector_PushBack[10000] N/A 34.1 µs N/A
🆕 WallTime BM_Vector_Reserve[1000] N/A 3.2 µs N/A
🆕 WallTime BM_RLE_Encode_LargeRuns[100000] N/A 201.8 µs N/A
🆕 WallTime BM_Vector_PushBack[100] N/A 744.5 ns N/A
🆕 WallTime BM_Vector_Reserve[100] N/A 350.9 ns N/A
🆕 WallTime BM_Vector_Reserve[10] N/A 66.8 ns N/A
... ... ... ... ... ...

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


Comparing cod-1945-support-memory-profiling-for-c (ad31ee3) with main (660b1f9)

Open in CodSpeed

@not-matthias not-matthias force-pushed the cod-1945-support-memory-profiling-for-c branch 2 times, most recently from b158911 to 003a1bf Compare January 15, 2026 17:20
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 memory profiling support to the benchmarking framework by introducing a new "memory" mode alongside the existing "simulation" and "walltime" modes. The changes unify the preprocessor directives and add the necessary configuration and infrastructure for memory profiling.

Changes:

  • Renamed CODSPEED_SIMULATION preprocessor macro to CODSPEED_ANALYSIS to better represent both simulation and memory profiling modes
  • Added "memory" as a new valid mode in CMake and Bazel build configurations
  • Removed warmup execution logic from simulation mode to reduce flakiness
  • Added memory benchmark examples demonstrating various allocation patterns
  • Updated CI workflows to test the new memory profiling mode with memtrack CLI installation

Reviewed changes

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

Show a summary per file
File Description
google_benchmark/src/benchmark_runner.cc Updated preprocessor directive from CODSPEED_SIMULATION to CODSPEED_ANALYSIS
google_benchmark/src/benchmark_api_internal.h Updated preprocessor directives and removed warmup execution logic
google_benchmark/src/benchmark_api_internal.cc Removed warmup repetition code from simulation mode
google_benchmark/src/benchmark.cc Updated preprocessor directives and console output message
google_benchmark/include/benchmark/benchmark.h Updated preprocessor directives throughout the State class
examples/google_benchmark_cmake/memory_bench.hpp Added new memory profiling benchmark examples with RLE encoding/decoding and allocation patterns
examples/google_benchmark_cmake/main.cpp Added include for new memory benchmark header
examples/google_benchmark_bazel/memory_bench.hpp Added symlink to cmake memory benchmark file
core/instrument-hooks Updated submodule commit reference
core/CMakeLists.txt Added "memory" to allowed modes and updated preprocessor definitions
core/BUILD Added memory_mode configuration and updated preprocessor defines
.github/workflows/ci.yml Added memory mode to test matrix and memtrack CLI installation steps

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

@GuillaumeLagrange
Copy link
Contributor

@not-matthias the ci fails, can you re-request a review once fixed ? 🙏

@GuillaumeLagrange GuillaumeLagrange removed their request for review January 16, 2026 09:00
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, just wanted input from @art049 regarding the removal of the warmup run in analysis mode

@not-matthias not-matthias force-pushed the cod-1945-support-memory-profiling-for-c branch 2 times, most recently from d1ba173 to 16f4e61 Compare January 19, 2026 17:41
@not-matthias not-matthias force-pushed the cod-1945-support-memory-profiling-for-c branch from 0247b66 to ad31ee3 Compare January 20, 2026 14:30
@not-matthias not-matthias merged commit ad31ee3 into main Jan 20, 2026
26 of 27 checks passed
@not-matthias not-matthias deleted the cod-1945-support-memory-profiling-for-c branch January 20, 2026 15:24
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.

4 participants