Skip to content

perf: add isolated dashboard stage and performance baseline - #129

Open
flamboh wants to merge 1 commit into
mainfrom
perf/harness
Open

flamboh wants to merge 1 commit into
mainfrom
perf/harness

Conversation

@flamboh

@flamboh flamboh commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Note

🤖 gpt-6.1-sol on behalf of Oliver

Result

Add an isolated self-hosted perf stage and a repeatable production dashboard benchmark. This is layer 1 of the frontend overhaul stack, based on main. It records the baseline before chart, query, branding, or UI changes.

The perf container uses an atlantis-perf namespace, loopback port 8090, a read-only product mount, and external Alchemy state. It rejects port 8080, writable data, and state inside the checkout. Existing stage defaults remain unchanged. The launcher anchors state outside the worktree while building from the checkout.

bun run perf measures 35 metadata/query cases with warmups, full-body API p50/p95, JS/CSS sizes and static route dependencies, and six page flows in fresh Playwright contexts. It captures TTFB, FCP, LCP, initial/all-chart readiness, long tasks, observed TBT, heap, and resource timings. It writes JSON and Markdown outside the repository and fails on API/browser/chart/build mismatches. bun run perf:bundle exports the Docker build so measured assets match the deployment, including Tailwind's Docker input exclusions.

Baseline before later layers

Recorded on the full 395-day v5 product. Query dates are 2025-06-01 through 2026-10-06 for the UI default, a 180-day range, and seven-day hourly source/direction and IPv6 variants. The default preserves unknown coverage beyond the proven product bounds.

API measurements use one discarded warmup and five sequential samples per case. Browser measurements use three fresh contexts per page, Chromium 147, a 1280 x 800 viewport, reduced motion, and no throttling. Browser SSR routes are not separately warmed. The server has a 1 GiB container limit and 768 MiB Node heap limit. No builds or tests ran alongside the full baseline.

Default API p50 ms p95 ms Decoded KiB
/api/netflow/stats 30.0 35.2 532.9
/api/netflow/characteristics 29.1 35.4 303.4
/api/ip/stats 24.0 27.4 286.8
/api/protocol/stats 19.3 20.0 244.7
/api/netflow/coverage 11.4 15.7 174.9
/api/netflow/dimension-stats 24.6 28.3 367.1
/api/netflow/spectrum-stats 61.9 87.2 2969.7
/api/netflow/structure-stats 102.5 110.7 4882.4
Page TTFB p50 ms FCP p50 ms LCP p50 ms Visible charts p50/p95 ms All charts p50 ms Initial observed TBT p50 ms All-chart heap p50 MiB
datasets 11.5 80.0 80.0 n/a n/a 0 4.4
dashboard-default 23.7 136.0 136.0 509.1/642.6 3258.9 130 31.3
dashboard-long-range 20.7 124.0 124.0 456.3/471.6 2722.8 104 13.8
dashboard-filtered-hourly 19.4 116.0 116.0 400.3/438.5 2691.2 61 18.0
files 7.0 72.0 72.0 n/a n/a 0 4.4
file-detail 7.9 120.0 744.0 729.7/798.8 729.7 411 14.9
Build Raw KiB Gzip KiB
All JS 711.6 228.1
All CSS 60.8 10.5
/ with dependencies 395.4 114.1
/datasets/[dataset] with dependencies 682.3 208.4
/datasets/[dataset]/alerts with dependencies 410.9 119.0
/netflow/files with dependencies 398.6 115.5
/netflow/files/[slug] with dependencies 591.4 183.4

Route totals overlap through shared dependencies. Gzip is level 9 per file. All-chart time includes a fixed initial settling interval and explicit GC. Observed TBT covers FCP through initial readiness plus settling, and is not Lighthouse TBT. Lighthouse was not run. There is no after comparison in this layer because it establishes the initial measurement procedure.

Hotspots for later layers

  • The all-source structure and spectrum responses are 4.8 MiB and 2.9 MiB decoded. The actual default dashboard's one-source spectrum response is about 861 KiB.
  • The chart-related shared chunk is 185.0 KiB raw / 63.4 KiB gzip. Chart code remains statically imported despite deferred card mounting.
  • The dashboard entry is 99.2 KiB raw. Simple dataset selection still needs 114.1 KiB gzip including shared boot/layout/CSS.
  • The Zod chunk adds 55.9 KiB raw / 15.2 KiB gzip to client URL parsing.
  • File detail creates 12 canvases, records 411 ms initial TBT at p50, and issues two successful identical summary requests. Both mount and navigation hooks refresh the loader.
  • The complete default dashboard uses about 925 ms of script time and 914 ms of long tasks. Heap is 31.3 MiB before GC and 18.3 MiB after GC.
  • Traffic queries return all metric/family columns and use a temporary B-tree for grouping. Read-only plans confirm indexes for traffic, MAAD, and coverage; no representative full-table scan was observed.

Full JSON, Markdown, and ten detailed hotspot notes remain in the requested local artifact directory. Private paths, captures, database contents, and report files are absent from the commit.

Human review guide

  1. Follow the performance setup and measurement guide. Export private host settings outside the checkout, including an external state directory and the UID/GID that can read the product.
  2. Deploy perf. Verify loopback 8090, a healthy atlantis-perf-web, a read-only /data mount, and populated real traffic. Check that other stages keep their existing names/defaults. Review the special perf defaults and guards.
  3. Export the Docker bundle and run bun run perf with fixed dates. Expect 35 API cases, 18 browser loads, passing JSON/Markdown, and a nonzero exit for a failed API or mismatched local build.
  4. Review missing and unavailable charts, source aliases, inclusive Pacific dates, DST boundaries, and unknown coverage after source bounds. Read the measurement definitions before comparing later layers.

Remaining manual check: connect through SSH forwarding from another computer. This task verified the local loopback deployment and automated browser flows. An independent test-stage redeploy occurred in its own checkout during verification, before baseline capture; this task deployed only perf.

Automated verification

  • bun run format, bun run lint, and bun run typecheck passed.
  • bun run test:infra: 37 tests passed.
  • bun run test:web: 215 tests passed.
  • bun run test:e2e: 26 tests passed.
  • Full v5 benchmark: 175 measured API requests and 18 page loads, zero errors.
  • Read-only Docker mount, external perf state, populated traffic, and unchanged database size/mtime/inode/link count verified.

Implemented by gpt-6.1-sol in the Codex harness through T3 Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant