From bb39cba50411bc76b91b1afba7dcdaccde4b1134 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Tue, 20 Jan 2026 14:29:48 +0000 Subject: [PATCH] ci: partition bench codspeed job (#20332) Co-authored-by: Matthias Seitz --- .github/scripts/codspeed-build.sh | 14 -------------- .github/workflows/bench.yml | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 16 deletions(-) delete mode 100755 .github/scripts/codspeed-build.sh diff --git a/.github/scripts/codspeed-build.sh b/.github/scripts/codspeed-build.sh deleted file mode 100755 index 9976a3314c..0000000000 --- a/.github/scripts/codspeed-build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -# TODO: Benchmarks run WAY too slow due to excessive amount of iterations. - -cmd=(cargo codspeed build --profile profiling) -crates=( - -p reth-primitives - -p reth-trie - -p reth-trie-common - -p reth-trie-sparse -) - -"${cmd[@]}" --features test-utils "${crates[@]}" diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 264b1059ab..886919a9e5 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -17,6 +17,16 @@ name: bench jobs: codspeed: runs-on: depot-ubuntu-latest + strategy: + matrix: + partition: [1, 2] + total_partitions: [2] + include: + - partition: 1 + crates: "-p reth-primitives -p reth-trie-common -p reth-trie-sparse" + - partition: 2 + crates: "-p reth-trie" + name: codspeed (${{ matrix.partition }}/${{ matrix.total_partitions }}) steps: - uses: actions/checkout@v6 with: @@ -32,10 +42,10 @@ jobs: with: tool: cargo-codspeed - name: Build the benchmark target(s) - run: ./.github/scripts/codspeed-build.sh + run: cargo codspeed build --profile profiling --features test-utils ${{ matrix.crates }} - name: Run the benchmarks uses: CodSpeedHQ/action@v4 with: - run: cargo codspeed run --workspace + run: cargo codspeed run ${{ matrix.crates }} mode: instrumentation token: ${{ secrets.CODSPEED_TOKEN }}