forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (56 loc) · 1.82 KB
/
bench.yml
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
# Runs benchmarks.
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
BASELINE: base
IAI_CALLGRIND_RUNNER: iai-callgrind-runner
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: bench
jobs:
iai:
runs-on:
group: Reth
# Only run benchmarks in merge groups and on main
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Install Valgrind
run: sudo apt update && sudo apt install valgrind
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install iai-callgrind-runner
run: |
echo "::group::Install"
version=$(cargo metadata --format-version=1 |\
jq '.packages[] | select(.name == "iai-callgrind").version' |\
tr -d '"'
)
cargo binstall iai-callgrind-runner --version $version --no-confirm --no-symlinks --force
echo "::endgroup::"
echo "::group::Verification"
which iai-callgrind-runner
echo "::endgroup::"
- name: Checkout base
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref || 'main' }}
- name: Generate test vectors
run: cargo run --bin reth -- test-vectors tables
- name: Save baseline
run: cargo bench -p reth-db --bench iai --features test-utils -- --save-baseline=$BASELINE
- name: Checkout PR
uses: actions/checkout@v4
with:
clean: false
- name: Compare PR benchmarks
run: cargo bench -p reth-db --bench iai --features test-utils -- --baseline=$BASELINE