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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Benchmarks
# CPU-simulation benchmarks via CodSpeed (https://codspeed.io). CodSpeed runs
# each benchmark under an instruction-level CPU simulation instead of timing
# it on the wall clock, so results are close to deterministic on shared
# GitHub runners. It compares every PR against the base branch and posts the
# diff as a PR comment / check -- no baseline bookkeeping in this repo.
#
# Only `xml_micro` (pure CPU: parse, unique-id/hash, build) runs here. The
# `xml_macro` benches (real filesystem I/O + tokio fan-out) are excluded on
# purpose: simulation does not count syscalls and runs threads serially, so it
# can't measure what those benches exist for. Run them locally with
# `cargo bench --bench xml_macro`; end-to-end wall time, CPU time, parallelism
# and peak RSS are also tracked downstream by sf-decomposer's perf suite.
on:
push:
branches:
- main
pull_request:
# Lets CodSpeed trigger backfill runs on past commits to seed history.
workflow_dispatch:
permissions:
contents: read
concurrency:
group: bench-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
codspeed:
name: CodSpeed (xml_micro)
runs-on: ubuntu-latest
permissions:
contents: read
# OIDC login to CodSpeed; no CODSPEED_TOKEN secret needed for a public repo.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v2
with:
toolchain: stable
# Same reasoning as ci.yml: let Swatinem/rust-cache own caching.
cache: false
- uses: Swatinem/rust-cache@v2
with:
# See ci.yml: restoring ~/.cargo/bin can clobber the rustup proxy.
cache-bin: false
- name: Install cargo-codspeed
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed
- name: Build benchmarks
run: cargo codspeed build --bench xml_micro
- name: Run benchmarks
uses: CodSpeedHQ/action@v5
with:
mode: simulation
run: cargo codspeed run --bench xml_micro