Skip to content

Port ?perf=1 timing panel to Search Explorer (baseline step)#124

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

Port ?perf=1 timing panel to Search Explorer (baseline step)#124
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:perf/explorer-timing-panel

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented Apr 17, 2026

First of two PRs for the Explorer rethink. Establishes measured baseline before any architectural changes.

Adds performance.mark() at four natural boundaries (DuckDB init, facet summaries, count query, sample data query) plus the same perfPanel pattern from the Interactive Explorer (PR #118). Gated on ?perf=1.

Follow-up PR will add ?v=2 feature flag with the lite-parquet + lazy-description + no-RANDOM + lazy-Cesium rewrite, measured on the same panel for apples-to-apples.

🤖 Generated with Claude Code

First step toward the Explorer rethink: establish measured baseline
for the current slow implementation before touching architecture.

Adds performance.mark() hooks at four natural boundaries:
- explorer_db (DuckDB init + CREATE VIEW for samples/sample_facets)
- explorer_facets (2 KB facet summaries load)
- explorer_count (COUNT(*) on wide parquet through WHERE clause)
- explorer_samples (ORDER BY RANDOM() LIMIT N on wide parquet — the slow one)

New perfPanel cell gated on ?perf=1. Also shows ?v=2 in the header
so v1 vs v2 numbers can be compared side-by-side in follow-up PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rdhyee rdhyee merged commit 0fe19f2 into isamplesorg:main Apr 17, 2026
rdhyee added a commit to rdhyee/isamplesorg.github.io that referenced this pull request Apr 17, 2026
…RANDOM, lazy Cesium)

Four architectural moves, each gated on ?v=2. v1 stays unchanged.

1. Primary read surface: samples_map_lite.parquet (60 MB) instead of
   wide.parquet (278 MB). The lite file has every column the Explorer
   needs for the list + globe view except description.

2. No ORDER BY RANDOM(). v1 uses RANDOM() which forces a scan across
   row groups; v2 uses bare LIMIT, accepting row-order bias in exchange
   for ~20× query speedup on columnar parquet. (Trade-off acceptable
   for a viz sample; revisit if source clustering becomes visible.)

3. Lazy description fetch. v2 drops description from sampleData and
   adds a lazyDescription cell that queries wide.parquet for just the
   one pid when a sample is clicked. sampleCard falls back to
   lazyDescription when s.description is empty.

4. Lazy Cesium mount. v2 returns null from the viewer cell until
   viewMode === 'globe', so the viewer constructor (~500 ms) doesn't
   run for users who stay in list/table view. v1 mounts eagerly.

whereClause handles column-name drift (v1 uses `n`, v2 uses `source`)
and skips the otype filter for v2 (lite is samples-only). Text search
in v2 is limited to label + place_name (description isn't loaded
eagerly). v1 keeps description search.

Next: measure v2 and compare against the PR isamplesorg#124 baseline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rdhyee added a commit to rdhyee/isamplesorg.github.io that referenced this pull request Apr 17, 2026
…RANDOM, lazy Cesium)

Four architectural moves, each gated on ?v=2. v1 stays unchanged.

1. Primary read surface: samples_map_lite.parquet (60 MB) instead of
   wide.parquet (278 MB). The lite file has every column the Explorer
   needs for the list + globe view except description.

2. No ORDER BY RANDOM(). v1 uses RANDOM() which forces a scan across
   row groups; v2 uses bare LIMIT, accepting row-order bias in exchange
   for ~20× query speedup on columnar parquet. (Trade-off acceptable
   for a viz sample; revisit if source clustering becomes visible.)

3. Lazy description fetch. v2 drops description from sampleData and
   adds a lazyDescription cell that queries wide.parquet for just the
   one pid when a sample is clicked. sampleCard falls back to
   lazyDescription when s.description is empty.

4. Lazy Cesium mount. v2 returns null from the viewer cell until
   viewMode === 'globe', so the viewer constructor (~500 ms) doesn't
   run for users who stay in list/table view. v1 mounts eagerly.

whereClause handles column-name drift (v1 uses `n`, v2 uses `source`)
and skips the otype filter for v2 (lite is samples-only). Text search
in v2 is limited to label + place_name (description isn't loaded
eagerly). v1 keeps description search.

Next: measure v2 and compare against the PR isamplesorg#124 baseline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rdhyee added a commit that referenced this pull request Apr 17, 2026
…RANDOM, lazy Cesium) (#126)

Four architectural moves, each gated on ?v=2. v1 stays unchanged.

1. Primary read surface: samples_map_lite.parquet (60 MB) instead of
   wide.parquet (278 MB). The lite file has every column the Explorer
   needs for the list + globe view except description.

2. No ORDER BY RANDOM(). v1 uses RANDOM() which forces a scan across
   row groups; v2 uses bare LIMIT, accepting row-order bias in exchange
   for ~20× query speedup on columnar parquet. (Trade-off acceptable
   for a viz sample; revisit if source clustering becomes visible.)

3. Lazy description fetch. v2 drops description from sampleData and
   adds a lazyDescription cell that queries wide.parquet for just the
   one pid when a sample is clicked. sampleCard falls back to
   lazyDescription when s.description is empty.

4. Lazy Cesium mount. v2 returns null from the viewer cell until
   viewMode === 'globe', so the viewer constructor (~500 ms) doesn't
   run for users who stay in list/table view. v1 mounts eagerly.

whereClause handles column-name drift (v1 uses `n`, v2 uses `source`)
and skips the otype filter for v2 (lite is samples-only). Text search
in v2 is limited to label + place_name (description isn't loaded
eagerly). v1 keeps description search.

Next: measure v2 and compare against the PR #124 baseline.

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