Commit 8422c69
Add CodSpeed continuous performance testing (#2919)
This PR integrates [CodSpeed](https://codspeed.io) 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](https://github.com/CodSpeedHQ/codspeed-cpp), 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](https://github.com/apps/codspeed)
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.
---------
Co-authored-by: codspeed-hq[bot] <117304815+codspeed-hq[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Alex-PLACET <2400067+Alex-PLACET@users.noreply.github.com>1 parent 849665a commit 8422c69
3 files changed
Lines changed: 70 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
83 | | - | |
84 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
89 | | - | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| |||
0 commit comments