perf: add isolated dashboard stage and performance baseline#129

open1
main
perf/harness
opened18d agobyOoliver
View on GitHubTwo-way sync enabledPR last imported 3h ago

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 APIp50 msp95 msDecoded KiB
/api/netflow/stats30.035.2532.9
/api/netflow/characteristics29.135.4303.4
/api/ip/stats24.027.4286.8
/api/protocol/stats19.320.0244.7
/api/netflow/coverage11.415.7174.9
/api/netflow/dimension-stats24.628.3367.1
/api/netflow/spectrum-stats61.987.22969.7
/api/netflow/structure-stats102.5110.74882.4
PageTTFB p50 msFCP p50 msLCP p50 msVisible charts p50/p95 msAll charts p50 msInitial observed TBT p50 msAll-chart heap p50 MiB
datasets11.580.080.0n/an/a04.4
dashboard-default23.7136.0136.0509.1/642.63258.913031.3
dashboard-long-range20.7124.0124.0456.3/471.62722.810413.8
dashboard-filtered-hourly19.4116.0116.0400.3/438.52691.26118.0
files7.072.072.0n/an/a04.4
file-detail7.9120.0744.0729.7/798.8729.741114.9
BuildRaw KiBGzip KiB
All JS711.6228.1
All CSS60.810.5
/ with dependencies395.4114.1
/datasets/[dataset] with dependencies682.3208.4
/datasets/[dataset]/alerts with dependencies410.9119.0
/netflow/files with dependencies398.6115.5
/netflow/files/[slug] with dependencies591.4183.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.

Checks

All checks passed

Added 1 commit

  • perf: add isolated dashboard benchmark stage and measurements95a6065