Benchmarks And Runtime Performance

LabFrog keeps two separate runtime signals for the main request-time paths:

  • tests/test_runtime_performance.py is a coarse pytest guardrail with pass/fail thresholds.

  • scripts/benchmarks/runtime.py is 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 ms

  • Initial request/session bootstrap: < 1.5 s

  • Warm route state rebuild: median < 100 ms, max < 250 ms

Entry Navigation Checks

  • Prev/next navigation request cycle: median < 250 ms, max < 600 ms

  • Go-to-shot redirect plus final page render: median < 350 ms, max < 750 ms

Run the pass/fail regression checks with:

uv run poe perf-guardrails

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 median is the average median latency across shared runtime checks.

  • avg p95 is the average p95 latency across shared runtime checks.

  • avg max is 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-jsons to list the runtime and browser JSON files currently detected

  • uv run poe refresh-benchmark-docs to rebuild the benchmark tables in this page from the JSON files already present under doc/_static/artifacts/benchmarks/

  • uv run poe perf-all to run guardrails, store the current machine’s runtime baseline, and refresh the docs tables in one step

  • uv run poe perf-full to do the same plus the browser benchmark run

  • uv run poe perf-full-realdb to run the same flow while using a real instance config from CONFIG_NAME in .env (browser + runtime real-db benchmark). This flow now uses --network-path auto, which probes the configured Mongo endpoint and labels the run as local, vpn, or unknown.

Setup avg median avg p95 avg max Updated
In-memory Reference (mongomock)Simple averages across shared runtime checks.
Kristin-ASRock / Windowsmongomock | local
2 ms
2 ms
2 ms
2026-06-24
fwkt-webappsmongomock | local
6 ms
6 ms
6 ms
2026-04-22
Local Real DatabaseSimple averages across shared runtime checks.
labfrogdocker-demo-db | local
7 ms
7 ms
8 ms
2026-04-22
Kristin-ASRock / Windowsdocker-local | local
9 ms
10 ms
12 ms
2026-04-21
fwkt-webappsinstitutional-db | local
25 ms
25 ms
25 ms
2026-04-22
Remote Real DatabaseSimple averages across shared runtime checks.
Kristin-ASRock / Windowsinstitutional-db | vpn
647 ms
722 ms
731 ms
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 > Safari

  • per-browser supporting averages across shared checks: avg median, avg p95, and avg 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
med87 ms
p9595 ms
max98 ms
med151 ms
p95225 ms
max257 ms
med213 ms
p95229 ms
max235 ms
2026-06-24
fwkt-webappsmongomock | local
med305 ms
p95325 ms
max330 ms
med656 ms
p95856 ms
max1,624 ms
N/A 2026-04-22
Local Real DatabaseBest-browser averages across shared browser checks.
Kristin-ASRock | Windowsdocker-local | local
med111 ms
p95125 ms
max129 ms
med190 ms
p95238 ms
max267 ms
med214 ms
p95237 ms
max248 ms
2026-04-21
fwkt-webappsinstitutional-db | local
med430 ms
p95453 ms
max455 ms
med825 ms
p95892 ms
max904 ms
med781 ms
p95847 ms
max854 ms
2026-04-22
labfrogdocker-demo-db | local
med159 ms
p95174 ms
max176 ms
med258 ms
p95303 ms
max312 ms
med185 ms
p95219 ms
max223 ms
2026-04-22
Remote Real DatabaseBest-browser averages across shared browser checks.
Kristin-ASRock | Windowsinstitutional-db | vpn
med1,562 ms
p951,594 ms
max1,597 ms
med1,679 ms
p951,783 ms
max1,794 ms
med1,704 ms
p951,798 ms
max1,808 ms
2026-04-21