This document describes the synthetic probe-cycle benchmark under benchmarks/. It does not hit isocpp.org; it uses httpx.MockTransport so CI and contributors get a stable, repeatable signal.
Each run executes ISOProber.run_cycle() with a small fixed index + watchlist (same shape as tests/test_sources.py TestISOProberRunCycle). The mock server returns 200 with a recent Last-Modified header for every HEAD, and 200 HTML for GET when front text is fetched for recent hits (deterministic request counts for regression).
| Metric | Meaning |
|---|---|
| Wall seconds | Total time for one run_cycle() |
| Request count | Mock HEAD + GET calls |
| Peak concurrent | Max in-flight requests (bounded by http_concurrency) |
| Latency p50 / p95 / p99 | Per-request handler time in the mock |
benchmarks/baseline.json stores wall_seconds_median (with headroom for CI noise), regression_threshold_pct (default 20%), and min_request_count.
The regression test takes the median of three wall-clock samples (each with a fresh in-memory DB pool so discovered URLs do not shrink the probe list between samples).
Run locally:
uv run pytest benchmarks/ -m benchmark -v \
--bench-http-concurrency=8 \
--bench-poll-interval-minutes=30 \
--bench-per-request-delay-ms=0.15--bench-http-concurrency— maps toSettings.http_concurrency(async client semaphore).--bench-poll-interval-minutes— stored inSettings.poll_interval_minutesfor parity with production config (the scheduler is not exercised here).--bench-per-request-delay-ms— artificial delay inside the mock handler to simulate network latency.
- Normal: The benchmark completes within
baseline.wall_seconds_median × (1 + threshold%). - Degraded / investigate: A sustained wall-clock increase above that cap after unrelated changes, or a large drop in
request_countwithout intentional test changes (may indicate probes are being skipped earlier than expected). - Not comparable: Changing default benchmark CLI knobs or
baseline.jsonwithout regenerating from a known-good tree.
After an intentional performance change (or recalibrating mock delay defaults):
- Temporarily relax or remove the assertion, or run the harness in a scratch script.
- Record stable median-of-three wall times with default CLI options on
ubuntu-latestor locally. - Set
wall_seconds_medianinbaseline.jsonto a value with modest slack (e.g. ~10–25% above the raw median) so CI host variance does not flake. - Commit
baseline.jsonwith the PR that justifies the new envelope.