diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 32bc83a1e..b01d4ff7e 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.12' - uses: actions/cache@v3 id: cache-py @@ -48,10 +48,12 @@ jobs: - name: cache rust uses: Swatinem/rust-cache@v2 + with: + key: v1 - name: Compile pydantic-core for profiling run: | - pip install -e . --config-settings=build-args='--verbose' -v + pip install -e . --config-settings=build-args='--verbose --profile codspeed' -v env: CONST_RANDOM_SEED: 0 # Fix the compile time RNG seed RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata" @@ -64,7 +66,7 @@ jobs: - name: Compile pydantic-core for benchmarking run: | - pip install -e . --config-settings=build-args='--verbose' -v + pip install -e . --config-settings=build-args='--verbose --profile codspeed' -v env: CONST_RANDOM_SEED: 0 # Fix the compile time RNG seed RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata" diff --git a/Cargo.toml b/Cargo.toml index f7c859534..120b8496d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,11 @@ strip = true debug = true strip = false +[profile.codspeed] +inherits = "release" +debug = true +strip = false + [dev-dependencies] pyo3 = { version = "0.20.0", features = ["auto-initialize"] }