From 4b079f372d1d48289e0a8b8aee9f3319d2933d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 4 Sep 2026 15:51:27 +0200 Subject: [PATCH] ci: Measure allocations beside the CPU simulation The instrument is picked when the harness is compiled, not when it runs: asking the action for a mode the build was not configured for uploaded results CodSpeed found nothing in. So the mode becomes the matrix, and one Configure and one Build serve both, as the RISC-V workflow does it. Two things come along: a concurrency group, so a new push cancels the run it replaces, and the Hunter cache the other jobs already restore. Claude-Session: https://claude.ai/code/session_016UHPAGwcwXMjqhTLpT31K7 --- .github/workflows/codspeed.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 009b448c39..a4cee96124 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -13,6 +13,10 @@ on: # performance analysis in order to generate initial data. workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + env: BUILD_DIR: build CMAKE_BUILD_PARALLEL_LEVEL: 4 @@ -22,10 +26,16 @@ env: jobs: benchmark: - name: Benchmark + # The instrument is picked when the harness is compiled, so each one needs a build of its own. + name: ${{ matrix.mode }} + strategy: + fail-fast: false + matrix: + mode: [simulation, memory] # CodSpeed ships its instrumented Valgrind for Ubuntu 22.04, Ubuntu 24.04 and Debian 12 only, # and bails out with "Unsupported system" anywhere else, so the image cannot be `latest`. runs-on: ubuntu-24.04 + timeout-minutes: 60 permissions: contents: read # required for actions/checkout id-token: write # required for OIDC authentication with CodSpeed @@ -37,6 +47,12 @@ jobs: - name: Install GMP run: sudo apt-get -q update && sudo apt-get -qy install libgmp-dev + - name: Restore the Hunter cache + uses: actions/cache@v4 + with: + path: ~/.hunter/_Base/Cache + key: hunter-codspeed-${{ hashFiles('cmake/Hunter/*.cmake') }} + - name: Configure # The Release build type keeps the -O3 optimizations on, -g adds the debug information # needed by CodSpeed to attribute the measurements to the source code. CodSpeed recommends @@ -50,7 +66,7 @@ jobs: -DEVMONE_TESTING=ON -DEVMONE_PRECOMPILES_GMP=ON -DEVMONE_PRECOMPILES_LIBSECP256K1=ON - -DCODSPEED_MODE=simulation + -DCODSPEED_MODE=${{ matrix.mode }} - name: Build run: cmake --build $BUILD_DIR --target evmone-bench evmone-precompiles-bench @@ -59,7 +75,7 @@ jobs: - name: Benchmark the baseline VM uses: CodSpeedHQ/action@v5 with: - mode: simulation + mode: ${{ matrix.mode }} run: ${{ env.BUILD_DIR }}/bin/evmone-bench test/evm-benchmarks/benchmarks --benchmark_filter='baseline/(analyse|execute)' # Both the mainnet inputs and the modexp parameter sweep: the mainnet moduli are all odd @@ -67,5 +83,5 @@ jobs: - name: Benchmark the precompiles uses: CodSpeedHQ/action@v5 with: - mode: simulation + mode: ${{ matrix.mode }} run: ${{ env.BUILD_DIR }}/bin/evmone-precompiles-bench