Test files live under tests/benchmarks/; this directory holds documentation and baselines.json for the CI regression gate.
Repeatable local measurements for workspace listing, export, search, and summary-cache hot paths.
pip install -r requirements-lock.txt
pip install 'pytest>=8,<9' 'pytest-benchmark==4.0.0'
pytest tests/benchmarks/ --benchmark-only -o addopts= -v| Group | What |
|---|---|
| parse | list_workspace_projects(..., nocache=True) over 10 / 50 / 200 synthetic composers |
| export | POST /api/export (ZIP) over 10 / 50 composer corpora |
| search | GET /api/search over a 50-composer synthetic corpus |
| summary-cache | cache lookup (hit/miss), fingerprint (10/50/200), round-trip, tab-summary lookup |
Synthetic corpora are built in tests/benchmarks/conftest.py — no real Cursor storage dependency.
The benchmarks job on ubuntu-latest runs the full tests/benchmarks/ suite (--benchmark-json=benchmark-results.json), then scripts/check_benchmark_regression.py benchmark-results.json benchmarks/baselines.json.
- Fail when a gated mean exceeds its baseline by >20%
- Fail when a gated mean is <50% of baseline (stale — refresh after intentional speedups)
- Fail when a gated baseline name has no current result
- Warn for benchmarks without a baseline entry
- All benchmarks listed in
baselines.jsonare gated (no exclusion list)
Pinned runner: ubuntu-latest, --benchmark-min-rounds=5.
After intentional performance work, capture on ubuntu-latest (same OS as the gated CI job). Download benchmark-results.json from a CI artifact when possible:
python scripts/reduce_baselines.py benchmark-results.json benchmarks/baselines.json --slack 1.5For a quick local snapshot only (may not match CI timings):
make seed-baselines-localmake update-baselines is a deprecated alias for seed-baselines-local. Do not commit baselines from macOS/Windows unless you accept cross-OS gate skew.
| Target | Purpose |
|---|---|
make check-benchmarks |
Run suite + regression gate locally |
make seed-baselines-local |
Capture local timings into benchmarks/baselines.json (with slack) |
make clean-benchmark-artifacts |
Remove benchmark-results.json and benchmarks/_raw.json |