Skip to content

Add CodSpeed continuous performance testing#2919

Open
codspeed-hq[bot] wants to merge 2 commits into
masterfrom
codspeed-wizard-1779180695265
Open

Add CodSpeed continuous performance testing#2919
codspeed-hq[bot] wants to merge 2 commits into
masterfrom
codspeed-wizard-1779180695265

Conversation

@codspeed-hq
Copy link
Copy Markdown

@codspeed-hq codspeed-hq Bot commented May 19, 2026

This PR integrates CodSpeed for continuous performance monitoring of xtensor's existing benchmark suite.

What changed

benchmark/CMakeLists.txt -- The Google Benchmark dependency is replaced with CodSpeed's compatibility layer, which wraps Google Benchmark with CodSpeed instrumentation. When CODSPEED_MODE is not set (or set to off), the build behaves identically to upstream Google Benchmark. Two additional changes are made for CodSpeed compatibility:

  • -march=native is conditionally skipped in simulation mode, since valgrind does not support all native instruction sets.
  • The build type is set to RelWithDebInfo (instead of Release) when CodSpeed is active, to include debug symbols for flame graph profiling.

.github/workflows/codspeed.yml -- A new GitHub Actions workflow that builds and runs the full benchmark suite (160+ benchmarks) under CodSpeed's CPU simulation instrument on every push to master and on pull requests. The workflow uses OIDC authentication and follows the same dependency setup (micromamba, xsimd) as the existing benchmarks.yml.

README.md -- Added the CodSpeed badge.

How it works

CodSpeed's simulation mode runs each benchmark once through a CPU instruction counter (valgrind-based), producing deterministic measurements that are independent of CI environment load. This makes performance regressions detectable on standard ubuntu-latest runners without dedicated hardware.

Next steps

  1. Install the CodSpeed GitHub App on this repository to enable performance reports on pull requests.
  2. After merging, CodSpeed will automatically create a performance baseline from the master branch.
  3. Subsequent PRs will receive performance comparisons showing regressions and improvements.

@codspeed-hq
Copy link
Copy Markdown
Author

codspeed-hq Bot commented May 19, 2026

@codspeed-hq codspeed-hq Bot marked this pull request as ready for review May 19, 2026 09:10
@Alex-PLACET Alex-PLACET requested a review from JohanMabille May 19, 2026 11:26
@Alex-PLACET
Copy link
Copy Markdown
Contributor

@copilot fix linting by running "pre-commit run -a"

Copy link
Copy Markdown

Copilot AI commented May 19, 2026

@copilot fix linting by running "pre-commit run -a"

Done in commit 5ddec5d: I ran pre-commit run -a, applied the required auto-formatting in .github/workflows/codspeed.yml, and re-ran pre-commit run -a successfully.

Copilot AI requested a review from Alex-PLACET May 19, 2026 11:40
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