Benchmarks And Runtime Performance
LabFrog keeps two separate runtime signals for the main request-time paths:
tests/test_runtime_performance.pyis a coarse pytest guardrail with pass/fail thresholds.scripts/benchmarks/runtime.pyis the repeatable benchmark runner that collects timed samples and reports distributions.
Neither one is a production MongoDB latency benchmark. Both use the in-memory mongomock fixture so the numbers stay focused on LabFrog request-time Python work.
Guardrail Checks
Core Request-State Checks
Dynamic form build: median
< 350 ms, max< 750 msInitial request/session bootstrap:
< 1.5 sWarm route state rebuild: median
< 100 ms, max< 250 ms
Runtime Benchmarks
Run the benchmark report with:
uv run poe perf-runtime
Write a report to JSON when you want to compare or archive a local run:
uv run python scripts/benchmarks/runtime.py --json-out labfrog-runtime-benchmark.json
Update the stored row for a specific scenario with:
uv run python scripts/benchmarks/runtime.py --scenario-label "Local dev / Linux / mongomock / local" --machine-label "local-dev" --os-label "Linux" --db-target "mongomock" --network-path "local" --update-baseline
The runner uses warmups, repeated samples, and distribution metrics (min, mean, median, p95, max). Treat these numbers as request-path Python timing on the mongomock fixture, not as production MongoDB latency.
New runtime runs also exercise two user-style navigation paths on the Flask test client:
prev/next navigation by loading
tab1?index=...go-to-shot navigation by loading
goto_shot_SHOT?...and following the redirect back to the add-entry page
The docs table below only compares metrics that exist in every stored scenario JSON. Older stored baselines still render cleanly while the newer navigation metrics are phased in through refreshed benchmark runs.
Runtime Comparison
Rows in this table are generated from recorded scenario baselines. A scenario is only shown after it has been run and accepted into the repo baseline with --update-baseline.
The runtime table is intentionally compact:
avg medianis the average median latency across shared runtime checks.avg p95is the average p95 latency across shared runtime checks.avg maxis the average max latency across shared runtime checks.
If you only need to rebuild the docs from JSON files already in the repo, use:
uv run poe check-benchmark-jsonsto list the runtime and browser JSON files currently detecteduv run poe refresh-benchmark-docsto rebuild the benchmark tables in this page from the JSON files already present underdoc/_static/artifacts/benchmarks/uv run poe perf-allto run guardrails, store the current machine’s runtime baseline, and refresh the docs tables in one stepuv run poe perf-fullto do the same plus the browser benchmark runuv run poe perf-full-realdbto run the same flow while using a real instance config fromCONFIG_NAMEin.env(browser + runtime real-db benchmark). This flow now uses--network-path auto, which probes the configured Mongo endpoint and labels the run aslocal,vpn, orunknown.
| Setup | avg median | avg p95 | avg max | Updated |
|---|---|---|---|---|
In-memory Reference (mongomock)Simple averages across shared runtime checks. |
||||
Kristin-ASRock / Windowsmongomock | local |
2026-06-24 | |||
fwkt-webappsmongomock | local |
2026-04-22 | |||
Local Real DatabaseSimple averages across shared runtime checks. |
||||
labfrogdocker-demo-db | local |
2026-04-22 | |||
Kristin-ASRock / Windowsdocker-local | local |
2026-04-21 | |||
fwkt-webappsinstitutional-db | local |
2026-04-22 | |||
Remote Real DatabaseSimple averages across shared runtime checks. |
||||
Kristin-ASRock / Windowsinstitutional-db | vpn |
2026-04-21 | |||
Browser Benchmarks
Install Playwright once if browser benchmarks are not available yet:
uv run poe install-playwright
On WSL/Linux, if browser system packages are also missing:
uv run poe install-playwright-with-deps
Run the browser benchmark with:
uv run poe perf-browser
Store a browser baseline for the current setup with:
uv run python scripts/benchmarks/browser_runtime.py --machine-label "local-dev" --os-label "Linux" --db-target "mongomock" --network-path "local" --update-baseline
The browser runner records tab1_domcontentloaded, tab1_form_ready, tab2_form_ready, tab2_previous_ready, tab2_next_ready, and tab2_goto_shot_ready. The last three are real browser-side interactions on the Tab 2 toolbar: clicking previous, clicking next, and typing a shot number then pressing Go. On Linux, Safari is represented by Playwright WebKit. If one browser stalls, the runner marks it as unavailable instead of waiting forever.
Recorded Browser Benchmarks
Rows in this section are generated from recorded browser baselines. The comparison table keeps a fixed browser order and uses compact bars for the shared timing summaries:
Chromium > Firefox > Safariper-browser supporting averages across shared checks:
avg median,avg p95, andavg max
New metrics appear in fresh benchmark runs immediately. The shared docs table only includes metrics that exist in every stored browser baseline JSON until older baselines are refreshed.
Browser Comparison
| Setup | Chromium | Firefox | Safari (WebKit) | Updated |
|---|---|---|---|---|
In-memory Reference (mongomock)Best-browser averages across shared browser checks. |
||||
Kristin-ASRock | Windowsmongomock | local |
2026-06-24 | |||
fwkt-webappsmongomock | local |
N/A | 2026-04-22 | ||
Local Real DatabaseBest-browser averages across shared browser checks. |
||||
Kristin-ASRock | Windowsdocker-local | local |
2026-04-21 | |||
fwkt-webappsinstitutional-db | local |
2026-04-22 | |||
labfrogdocker-demo-db | local |
2026-04-22 | |||
Remote Real DatabaseBest-browser averages across shared browser checks. |
||||
Kristin-ASRock | Windowsinstitutional-db | vpn |
2026-04-21 | |||