Skip to content

Commit 9d4ef24

Browse files
magentaqinremimimimimitdejagerhaecker-felixHofer-Julian
committed
perf: setup codspeed to track performance regression (#4519)
Co-authored-by: remimimimimi <remimimimimi@protonmail.com> Co-authored-by: Tim de Jager <tim@prefix.dev> Co-authored-by: Felix Häcker <felix@prefix.dev> Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Co-authored-by: Lucas Colley <lucas.colley8@gmail.com> Co-authored-by: Bas Zalmstra <4995967+baszalmstra@users.noreply.github.com> Co-authored-by: Julian Hofer <julianhofer@gnome.org> Co-authored-by: Valentin Kharin <33205215+remimimimimi@users.noreply.github.com>
1 parent cbb724d commit 9d4ef24

26 files changed

+3318
-53
lines changed

.github/actionlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
self-hosted-runner:
22
labels:
3+
- "codspeed-macro"
34
- 8core_ubuntu_latest_runner
45
- 16core_windows_latest_runner
56
- windows_arm64_2025_large

.github/workflows/benchmark.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CodSpeed
2+
3+
on:
4+
push:
5+
branches:
6+
- "feature/codespeed" # or "master"
7+
pull_request: # required to have reports on PRs
8+
# `workflow_dispatch` allows CodSpeed to trigger backtest
9+
# performance analysis in order to generate initial data.
10+
workflow_dispatch:
11+
12+
jobs:
13+
benchmarks:
14+
name: Run benchmarks
15+
runs-on: codspeed-macro
16+
env:
17+
RUST_BACKTRACE: full
18+
steps:
19+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
20+
21+
- name: Install system dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y tar bzip2
25+
26+
- name: Setup rust toolchain, cache and cargo-codspeed binary
27+
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e
28+
with:
29+
channel: stable
30+
cache-target: release
31+
bins: cargo-codspeed
32+
33+
- name: Build the benchmark target(s)
34+
run: cargo codspeed build -p pixi_bench
35+
36+
- name: Run the benchmarks
37+
uses: CodSpeedHQ/action@cc824aeb2c86848c39cf722ab4c2b6c5bf290530
38+
with:
39+
run: |
40+
export PATH="~/.cargo/bin:$PATH"
41+
cargo codspeed run -p pixi_bench
42+
mode: walltime
43+
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
with:
108108
save-if: ${{ github.ref == 'refs/heads/main' }}
109109
- run: |
110-
for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do
110+
for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name != "pixi_bench") | .name'); do
111111
cargo rustdoc -p "$package" --all-features -- -D warnings -W unreachable-pub
112112
done
113113

0 commit comments

Comments
 (0)