blob: 3251db252fc3a894d179ffb8c629d38ee9d2077a [file] [edit]
name: CodSpeed (simulation)
# In-process benches under callgraph instrumentation for per-function
# attribution on the dashboard. Cold-start subprocess benches need
# wall-clock measurement and live in codspeed-walltime.yaml.
on:
push:
branches:
- main
- maintenance/**
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
# mode: simulation captures a callgraph per benchmark for per-function
# attribution on the dashboard. That instrumentation is ~10-50x slower
# than wall-clock, so end-to-end benches over real codebases need
# generous budget. The 3-bench suite takes ~22 min on the baseline;
# a perf regression PR can easily double that.
timeout-minutes: 60
steps:
- name: Check out code from GitHub
uses: actions/checkout@v7.0.0
- name: Set up Python 3.14
id: python
uses: actions/setup-python@v6.3.0
with:
python-version: "3.14"
check-latest: true
- name: Install dependencies
run: |
python -m pip install -U pip
pip install pytest-codspeed
pip install .
- name: Run in-process benchmarks
uses: CodSpeedHQ/action@v4.18.1
with:
mode: simulation
# Skip cold_lint here — it shells out to a subprocess that
# simulation mode cannot see into; see codspeed-walltime.yaml.
run: pytest tests/benchmarks/ --codspeed -k "not cold_lint"