Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
de041f9
ci: Use `codspeed` for benchmarking
larseggert Oct 24, 2025
478ad4d
Minimize
larseggert Oct 24, 2025
8fdf449
.github/workflows/codspeed.yml
larseggert Oct 24, 2025
0fa31d0
Merge branch 'main' into ci-codspeed
larseggert Oct 29, 2025
fdaf47f
Install cargo-codspeed
larseggert Oct 29, 2025
1582a73
Fixes
larseggert Oct 29, 2025
98f3e25
Fixes
larseggert Oct 29, 2025
b748fcd
Merge branch 'main' into ci-codspeed
larseggert Oct 29, 2025
bd2af17
Fixes
larseggert Oct 29, 2025
a4a7178
Remove comment
larseggert Oct 29, 2025
62a2a61
Use different measurement modes
larseggert Oct 29, 2025
f22b93b
Fix
larseggert Oct 29, 2025
8638d28
Update .github/workflows/codspeed.yml
larseggert Oct 29, 2025
d97578d
Update .github/workflows/codspeed.yml
larseggert Oct 29, 2025
bf7c123
Fix
larseggert Oct 29, 2025
0cdb597
Shard benches
larseggert Oct 30, 2025
2f72a0d
No jq
larseggert Oct 30, 2025
67e2f49
Rust
larseggert Oct 30, 2025
0eb9402
Update .github/workflows/codspeed.yml
larseggert Oct 30, 2025
1ffe3e9
Again
larseggert Oct 30, 2025
11598b9
cat
larseggert Oct 30, 2025
ab3a71a
Update neqo-http3/Cargo.toml
larseggert Oct 30, 2025
624f7a0
Again
larseggert Oct 30, 2025
b24d9b2
Merge branch 'ci-codspeed' of github.com:larseggert/neqo into ci-cods…
larseggert Oct 30, 2025
743369f
Again
larseggert Oct 30, 2025
b0a57e7
Update .github/workflows/codspeed.yml
larseggert Oct 30, 2025
4633138
Fixes
larseggert Oct 30, 2025
ce344ef
Bump codspeed
larseggert Nov 7, 2025
7fa5d75
Merge branch 'main' into ci-codspeed
larseggert Nov 7, 2025
46ace57
Merge
larseggert Nov 7, 2025
7aeece4
Remove FIXME
larseggert Nov 11, 2025
c084f2b
Merge branch 'main' into ci-codspeed
larseggert Nov 11, 2025
4f9e5e6
Cargo.lock
larseggert Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CodSpeed Benchmarks
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
merge_group:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
bench-matrix:
name: Determine benchmark matrix
runs-on: ubuntu-24.04
outputs:
benches: ${{ steps.benches.outputs.benches }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- id: benches
run: |
# Create a GitHub matrix where each entry is a bench with its
# associated crate and benchmarking mode taken from the Cargo
# metadata.
{
echo -n "["
first=true
while IFS=: read -r crate manifest_path; do
dir=$(dirname "$manifest_path")
if [ -e "$dir/benches" ]; then
for bench in "$dir/benches"/*.rs; do
bench=$(basename -s .rs "$bench")
# Set measurement mode from Cargo.toml metadata, default to "instrumentation".
Comment thread
larseggert marked this conversation as resolved.
mode=$(cargo metadata --no-deps --format-version 1 | jq -r --arg crate "$crate" --arg bench "$bench" '.packages[] | select(.name == $crate) | .metadata.bench[$bench].codspeed.mode // "instrumentation"')
if [ "$first" = true ]; then
first=false
else
echo -n ","
fi
echo -n "{\"crate\":\"$crate\",\"bench\":\"$bench\",\"mode\":\"$mode\"}"
done
fi
done < <(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | .name + ":" + .manifest_path')
echo -n "]"
} > benches.json
cat benches.json
echo "benches=$(cat benches.json)" >> "${GITHUB_OUTPUT}"

benchmarks:
name: Run benchmarks
runs-on: ubuntu-24.04
strategy:
matrix:
bench: ${{ fromJson(needs.bench-matrix.outputs.benches) }}
needs: bench-matrix

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- uses: ./.github/actions/rust
with:
version: stable
tools: cargo-codspeed
token: ${{ secrets.GITHUB_TOKEN }}

- id: nss-version
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"

- uses: ./.github/actions/nss
with:
minimum-version: ${{ steps.nss-version.outputs.minimum }}

- env:
BENCH: ${{ matrix.bench.bench }}
CRATE: ${{ matrix.bench.crate }}
MODE: ${{ matrix.bench.mode }}
run: |
echo "Building benchmark '$BENCH' in crate '$CRATE' with measurement mode '$MODE'"
cargo codspeed build --package "$CRATE" --locked --features bench --bench "$BENCH" --measurement-mode "$MODE"

- name: Run the benchmarks
uses: CodSpeedHQ/action@4348f634fa7309fe23aac9502e88b999ec90a164 # v4.3.1
with:
mode: ${{ matrix.bench.mode }}
Comment thread
larseggert marked this conversation as resolved.
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
Loading
Loading