-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.63 KB
/
Copy pathbench.yml
File metadata and controls
54 lines (50 loc) · 1.63 KB
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
name: Benchmarks
# GitHub-hosted runners are noisy — benches here track the *order of magnitude*
# baseline rather than fail on small regressions. They run on master pushes and
# on demand. PRs intentionally do NOT run benches: they're slow and the noise
# floor would just produce false alarms.
on:
push:
branches: [master, main]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
bench:
name: Criterion benches
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Bench builds use the release profile; cache it under its own key
# so it doesn't fight with the test job's debug cache.
key: bench
- name: Run criterion benches (each macro)
run: |
set -euo pipefail
mkdir -p bench-output
while read -r crate bench
do
echo "::group::$crate/$bench"
cargo bench -p "$crate" --bench "$bench" -- \
--warm-up-time 1 --measurement-time 3 \
| tee "bench-output/$crate-$bench.txt"
echo "::endgroup::"
done <<'BENCHES'
ras-jsonrpc-macro dispatch
ras-rest-macro dispatch
ras-file-macro streaming
ras-jsonrpc-bidirectional-macro roundtrip
BENCHES
- name: Upload bench artifacts
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: criterion-results
path: |
bench-output/
target/criterion/
retention-days: 30