Skip to content

Add opt-in ?perf=1 timing panel to Interactive Explorer#118

Merged
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:feat/perf-timing-panel
Apr 17, 2026
Merged

Add opt-in ?perf=1 timing panel to Interactive Explorer#118
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:feat/perf-timing-panel

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented Apr 17, 2026

First step of the "progressive globe as reference design" strategy: ground performance work in numbers before optimizing.

What it measures

Instruments three natural hook points with `performance.mark()`:

  • `duckdb_init` — `DuckDBClient.of()` call
  • `viewer_init` — Cesium Viewer construction
  • `first-globe-frame` — first `scene.postRender` callback

A new `perfPanel` cell reads these plus the browser's paint entries and the existing `p1`/`r{res}` measures, and renders a small fixed panel in the bottom-right.

How to use

  • Normal visit: no change, panel is hidden.
  • Append `?perf=1` to the URL: panel appears with navigation-relative timings.
  • Also dumps to `console.table` for CI / Playwright capture.

Baseline (local, headless Chrome, warm R2)

Metric ms
first-paint 370
duckdb_init 1470
viewer_init 43
nav → viewer ready 2590
nav → first globe frame 2620
phase 1 res4 duration 3980
nav → phase 1 complete 6570

Next

Drive against these numbers with: preload hints for critical parquets, DuckDB init off main thread earlier, R2 `cache-control` audit.

🤖 Generated with Claude Code

First step of the "progressive globe as reference design" strategy:
ground performance work in numbers before optimizing.

Instruments three natural hook points with performance.mark():
- duckdb_init (DuckDBClient.of() call)
- viewer_init (Cesium.Viewer construction)
- first-globe-frame (first scene.postRender callback)

A new perfPanel cell reads these marks plus the browser's paint
entries and the existing p1/r{res} measures, and renders a small
fixed panel in the bottom-right. Gated on ?perf=1 — off by default
in production. Also dumps to console.table for CI capture.

Baseline (local, headless Chrome, warm R2):
- first-paint 370 ms
- duckdb_init 1.47 s
- nav → viewer ready 2.59 s
- nav → phase 1 complete 6.57 s

Next optimizations to drive against these numbers: preload critical
parquets, DuckDB init off main thread earlier, R2 cache header audit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rdhyee rdhyee merged commit 656e9ed into isamplesorg:main Apr 17, 2026
1 check passed
rdhyee added a commit to rdhyee/isamplesorg.github.io that referenced this pull request Apr 17, 2026
Warms the network for the two parquet files on the phase 1 critical
path so the browser starts fetching them before Cesium is parsed and
DuckDB-WASM asks for them:

- preconnect to data.isamples.org (DNS + TLS early)
- preload the res4 H3 summary (580 KB — primary cluster data)
- preload the facet summaries (2 KB — instant filter counts)

Expected win: 200-500 ms off "nav → phase 1 complete" on cold cache,
less on warm. Measured against the ?perf=1 panel from PR isamplesorg#118.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rdhyee added a commit that referenced this pull request Apr 17, 2026
Warms the network for the two parquet files on the phase 1 critical
path so the browser starts fetching them before Cesium is parsed and
DuckDB-WASM asks for them:

- preconnect to data.isamples.org (DNS + TLS early)
- preload the res4 H3 summary (580 KB — primary cluster data)
- preload the facet summaries (2 KB — instant filter counts)

Expected win: 200-500 ms off "nav → phase 1 complete" on cold cache,
less on warm. Measured against the ?perf=1 panel from PR #118.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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