Skip to content

Performance tooling: profiling harness + render-equivalence suite - #2078

Merged
jameshadfield merged 4 commits into
v3from
perf-infra
Aug 23, 2026
Merged

Performance tooling: profiling harness + render-equivalence suite#2078
jameshadfield merged 4 commits into
v3from
perf-infra

Conversation

@trvrb

@trvrb trvrb commented Jul 1, 2026

Copy link
Copy Markdown
Member

Via Claude

Summary

Tooling for the performance effort (no user-facing behavior change). The actual render optimizations land in a stacked follow-up PR (perf-implement → this branch), so the tooling can be reviewed separately from the behavioral changes.

Three commits:

  1. Profiling timer instrumentation — wraps modifySVG in a timerStart/End and adds a missing timerEnd("mapToScreen") (its timerStart had no matching end, tripping a race warning and never logging). Timer calls are stripped from normal builds — compiled in only via auspice build --includeTiming — so this is inert in production.

  2. Headless profiling harness (npm run profile, test/profiling/) — builds a --includeTiming production bundle, serves the local data/ dir, drives Auspice headless against representative datasets, captures the perf.js console timers, and writes a ranked baseline with before/after diffing (--baseline).

  3. Render-equivalence regression suite (npm run render-equiv) — for each operation (colorBy, layout, distance, filter, zoom, confidence, …) and for sequences of operations, drives the incremental phylotree.change() path (via history.pushState + a popstate event — the app's own listener, zero source changes) and asserts the settled SVG DOM is identical to a from-scratch full render of the same end state. A mismatch is a stale-DOM regression. Covers ebola/zika/spike-sm.

Test plan

  • npm run render-equiv -- --build → all scenarios green (blanket-flag behaviour is trivially equivalent on this branch).
  • npm run profile -- --build → produces a ranked baseline.
  • tsc + eslint clean.

🤖 Generated with Claude Code

@trvrb trvrb changed the title Perf tooling: profiling harness + render-equivalence suite Performance tooling: profiling harness + render-equivalence suite Jul 1, 2026
@trvrb
trvrb requested a review from jameshadfield July 2, 2026 00:00
@jameshadfield
jameshadfield force-pushed the v3 branch 2 times, most recently from fb4fe78 to 4d9e17a Compare July 13, 2026 02:16
trvrb and others added 4 commits August 21, 2026 15:49
Instrument the incremental SVG-update path so the profiling harness can attribute
it: wrap modifySVG in a timer, and add the missing timerEnd("mapToScreen") (its
timerStart had no matching end, which tripped a race-condition warning and never
logged). Timer calls are stripped from normal builds; they are compiled in only
via `auspice build --includeTiming`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A reusable, measure-only harness (test/profiling/, `npm run profile`) that builds
a --includeTiming production bundle, serves the local data/ dir, drives Auspice
headless against representative datasets, captures the perf.js console timers, and
writes a ranked baseline (with before/after diffing via --baseline).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
renderEquivalence.mjs + domSnapshot.mjs assert that the incremental tree-update
path (phylotree.change()) produces DOM identical to a from-scratch full render of
the same state, for each operation and for sequences of operations.

Driving needs no source changes: history.pushState + a popstate event triggers
the app's own listener, which takes the incremental URL_QUERY_CHANGE branch — the
same change() path a control click uses. The golden reference is a fresh page at
the app's resulting URL. The comparator snapshots per-id tips/branches/conf
(reading style+attr, normalizing units/precision) and reports per-element diffs.

Covers colorBy (incl. genotype/continuous), all layouts, distance, date + trait
filters, zoom, temporal confidence, and combinations, across ebola/zika/spike-sm.
Run: `npm run render-equiv`. Supersedes the one-off verifyRenderEquivalence check.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Various updates to the performance tooling introduced by Opus 4.7
in the previous two commits. Dataset (name/URL) changes reflect
the new data situation in Auspice v3.
@jameshadfield
jameshadfield merged commit 66e4a91 into v3 Aug 23, 2026
14 checks passed
@jameshadfield
jameshadfield deleted the perf-infra branch August 23, 2026 23:39
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.

2 participants