|
1 |
| -# Runs benchmarks on serialization/deserialization of storage values and keys. |
| 1 | +# Runs benchmarks. |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | pull_request:
|
|
9 | 9 | env:
|
10 | 10 | CARGO_TERM_COLOR: always
|
11 | 11 | BASELINE: base
|
12 |
| - IAI_CALLGRIND_RUNNER: iai-callgrind-runner |
13 | 12 |
|
14 | 13 | concurrency:
|
15 | 14 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
16 | 15 | cancel-in-progress: true
|
17 | 16 |
|
18 | 17 | name: bench
|
19 | 18 | jobs:
|
20 |
| - iai: |
| 19 | + codspeed: |
21 | 20 | runs-on:
|
22 | 21 | group: Reth
|
23 |
| - # Only run benchmarks in merge groups and on main |
24 |
| - if: github.event_name != 'pull_request' |
25 | 22 | steps:
|
26 | 23 | - uses: actions/checkout@v4
|
27 |
| - - name: Install Valgrind |
28 |
| - run: sudo apt update && sudo apt install valgrind |
| 24 | + with: |
| 25 | + submodules: true |
| 26 | + - uses: rui314/setup-mold@v1 |
29 | 27 | - uses: dtolnay/rust-toolchain@stable
|
30 | 28 | - uses: Swatinem/rust-cache@v2
|
31 | 29 | with:
|
32 | 30 | cache-on-failure: true
|
33 |
| - - name: Install cargo-binstall |
34 |
| - uses: taiki-e/install-action@cargo-binstall |
35 |
| - - name: Install iai-callgrind-runner |
36 |
| - run: | |
37 |
| - echo "::group::Install" |
38 |
| - version=$(cargo metadata --format-version=1 |\ |
39 |
| - jq '.packages[] | select(.name == "iai-callgrind").version' |\ |
40 |
| - tr -d '"' |
41 |
| - ) |
42 |
| - cargo binstall iai-callgrind-runner --version $version --no-confirm --no-symlinks --force |
43 |
| - echo "::endgroup::" |
44 |
| - echo "::group::Verification" |
45 |
| - which iai-callgrind-runner |
46 |
| - echo "::endgroup::" |
47 |
| - - name: Checkout base |
48 |
| - uses: actions/checkout@v4 |
| 31 | + - name: Install cargo-codspeed |
| 32 | + uses: taiki-e/install-action@v2 |
49 | 33 | with:
|
50 |
| - ref: ${{ github.base_ref || 'main' }} |
51 |
| - # On `main` branch, generates test vectors and serializes them to disk using `serde-json`. |
52 |
| - - name: Generate test vectors |
53 |
| - run: cargo run --bin reth --features dev -- test-vectors tables |
54 |
| - # Runs iai and stores `main` baseline report for comparison later on $BASELINE. |
55 |
| - - name: Save baseline |
56 |
| - run: cargo bench -p reth-db --bench iai --profile profiling --features test-utils -- --save-baseline=$BASELINE |
57 |
| - - name: Checkout PR |
58 |
| - uses: actions/checkout@v4 |
| 34 | + tool: cargo-codspeed |
| 35 | + - name: Build the benchmark target(s) |
| 36 | + run: ./.github/scripts/codspeed-build.sh |
| 37 | + - name: Run the benchmarks |
| 38 | + uses: CodSpeedHQ/action@v3 |
59 | 39 | with:
|
60 |
| - clean: false |
61 |
| - # Runs iai on incoming merge using previously generated test-vectors and compares the report against `main` report. |
62 |
| - - name: Compare PR benchmarks |
63 |
| - run: cargo bench -p reth-db --bench iai --profile profiling --features test-utils -- --baseline=$BASELINE |
| 40 | + run: cargo codspeed run --workspace |
| 41 | + token: ${{ secrets.CODSPEED_TOKEN }} |
0 commit comments