Skip to content

RD-13 Phase 0 Baseline ​

Captured: 2026-11-13 00:10 (local) Product source: d65f93a (the Phase 0 planning commit; product code unchanged from d8c9fa9) Host: Intel 4 vCPU, 15 GiB RAM, Linux x64, Node 24.21.0, Chromium 158.0.8127.18 Mode: production demo build, Chromium headless, cache disabled, one fresh context per scenario Raw data: rd13-baseline.jsonScreenshots: plan evidence

Initial render ​

Five fresh loads per scenario. readyMs is the existing benchmark metric: module evaluation to the first painted benchmark frame.

Scenariop50p95maxDOM nodes
500 items, 14 months, 1×376.0 ms426.3 ms426.3 ms7,854
500 items, 14 months, 4× CPU1,671.8 ms1,789.3 ms1,789.3 ms7,854
2,000 items, 14 months, 1×1,789.2 ms2,042.2 ms2,042.2 ms17,850
2,000 items, 14 months, 4× CPU7,334.9 ms7,926.4 ms7,926.4 ms17,850

The 500-item 1× p95 is 426 ms against the 150 ms gate: 2.8× too slow. The 2,000-item p95 is 2,042 ms. The 4× diagnostic is 1,789 ms at 500 items and 7,926 ms at 2,000.

Drag ​

60 pointer moves from 2027-01-28 to 2027-02-16, select mode, compact density. work/frame is the profile-derived mean non-idle main-thread time per drag frame; input is the pointer-event → handler delay.

ScenarioFrame p95Input p95Work/frameLong tasksLong-task max
500 items, 1×16.7 ms15.7 ms7.75 ms199 ms
500 items, 4×33.4 ms16.1 ms30.08 ms4305 ms
2,000 items, 1×16.8 ms16.1 ms22.53 ms2700 ms
2,000 items, 4×50.0 ms16.6 ms86.37 ms202,642 ms

The frame cadence passes at 1× for both data sizes, but the 2,000-item work per frame is 22.5 ms against the 8 ms gate (2.8× too slow). Input delay is ~16 ms — one 60 Hz frame — so the Phase 0 decision is to gate work per frame at 8 ms and keep input delay at ≤16.7 ms. The 4× diagnostic exposes 20 long tasks at 2,000 items.

Click-to-select ​

Five samples per scenario. work is pointer-down → the cell's aria-selected changes; paint is pointer-down → the next animation frame.

ScenarioWork p50Work p95Paint p50Paint p95
500 items, 1×66.6 ms95.3 ms73.7 ms107.0 ms
500 items, 4×277.0 ms343.7 ms315.8 ms385.6 ms
2,000 items, 1×569.5 ms675.1 ms581.8 ms689.6 ms
2,000 items, 4×2,271.7 ms2,581.9 ms2,330.4 ms2,655.4 ms

This is the user-visible lag: a click at 2,000 items takes 675 ms to commit the selection, 13.5× the 50 ms gate. At 500 items it is 95 ms, 1.9× the gate.

CPU profile ​

The drag profile at 2,000 items ranks self-time as follows:

RankFunction (minified → source)2,000 items 1×2,000 items 4×
1buildAncestry (Xc) — packages/core/src/model/visibility.ts:15021.2%40.4%
2(program) / browser work12.6%22.9%
3(idle)55.5%17.4%
4anonymous bundle work2.9%5.1%
5formatPeriod1.0%1.8%

At 500 items buildAncestry is only 1.8% (1×) / 4.7% (4×). The growth from 1.8% to 21.2% is the signature of the per-item getEffectiveVisibility call: each call rebuilds the layer, item and group maps (visibility.ts:227-233). The fix already exists in the codebase: resolveItemVisibility (visibility.ts:241-246) builds the ancestry once and resolves every item in one pass. Phase 1 task 1.2.1 uses it.

Visual baseline ​

ScreenshotObservation
demo-1280x800.pngThe default demo shows only Dec–May (6 of 14 months) before the viewport ends; the page scrolls. The month labels are 18 px, bold and left-aligned.
bench-1280x800.pngThe 2,000 px grid is clipped on the right and shows about 8 of 14 months vertically.
bench-1440x900.pngStill clipped on both axes; no fit.
bench-1024x768.pngAbout 6 months visible; the grid extends beyond both axes.

The three full-page screenshots (*-full.png in the same evidence directory) show the complete 14-month planner. The visual baseline confirms the arithmetic: the fit must be two-dimensional, and at 1280 × 800 it will show one 24 px lane with the rest in overflow.

Story inventory ​

MetricCount
Story files12
Exported stories174
play functions4 (all in Accessibility.stories.tsx)
Component descriptions1
Story-level descriptions1
Stories missing a story-level description173

Phase 0 decision ​

Go, with one metric correction and one priority adjustment:

  1. Drag gate is work per frame, not frame interval. Gate mean main-thread work per drag frame at ≤8 ms and input delay at ≤16.7 ms. The current 2,000 item numbers are 22.5 ms and 16.1 ms. This preserves the 8 ms intent without asking for 120 fps on a 60 Hz host.
  2. First fix is the visibility pass. buildAncestry is the top self-time function and the click-to-select path is the worst user-visible metric. Replace per-item getEffectiveVisibility with one resolveItemVisibility map shared by the renderer, interaction engine and visible-item count.
  3. Start from the 150 ms initial-render and 50 ms click targets. The gaps are 2.8× and 13.5× at 500/2,000 items. Phase 1 removes the algorithmic work first; if a structural DOM cost remains, the target decision returns to the owner with the measured evidence (AR-40).
  4. No renderer rewrite. The profile shows algorithmic work, not React reconciliation. The React renderer stays; the imperative drag preview is still the only renderer escape hatch.

Risks carried into Phase 1 ​

RiskEvidenceMitigation
Initial render needs 2.8× at 500 items426 ms p95 vs 150 msVisibility map, row bucketing, memo stabilization
Click-to-select needs 13.5× at 2,000 items675 ms p95 vs 50 msVisibility map first; then measure again
4× degrades sharply7.9 s initial, 86 ms work/frameDiagnostics only; do not gate on the throttle
Fit at 1280 × 800 shows one laneGrid 2,000 × 1,332, viewport 1,280 × 800Two-dimensional fit; overflow preserves the rest
The target may need more than one phaseClick cost is dominated by a single known pathPhase 1 gate re-checks; re-scope only with new profile evidence

Phase 1 after ​

Measured on 2026-11-13 with the same production build and scenario definitions. Initial render and click use twenty samples (p95 is the second-worst sample); drag work is profile-derived over 60 frames. PERF_STRICT=1 passed 3/3.

ScenarioPhase 0 p95Phase 1 p95Phase 1 p50TargetStatus
Initial render, 500 items, 1×426.3 ms242.0 ms193.9 ms≤400 mspass
Initial render, 2,000 items, 1×2,042.2 ms346.4 ms318.7 ms≤550 mspass
Initial render, 500 items, 4×1,789.3 ms1,020.8 ms845.3 msdiagnosticrecorded
Initial render, 2,000 items, 4×7,926.4 ms1,562.5 ms1,439.8 msdiagnosticrecorded
Drag work/frame, 2,000 items, 1×22.53 ms4.9 ms—≤8 mspass
Drag input delay, 2,000 items, 1×16.1 ms14.2 ms—≤16.7 mspass
Click work, 500 items, 1×95.3 ms32.5 ms23.5 ms≤60 mspass
Click work, 2,000 items, 1×675.1 ms59.6 ms39.8 ms≤80 mspass

DOM size after the fix is 5,348 nodes at 500 items and 7,794 at 2,000 items (Phase 0: 7,854 and 17,850). The inspector's item list starts collapsed above 100 entries, so the accessibility entries are created on request instead of during first paint.

Phase 1 decision ​

The residual initial-render cost is the grid: 518 cells, 447 / 1,190 item fragments and 332 / 723 proxies, plus browser layout. Reaching 150 ms requires row windowing; it is not reachable by removing more algorithmic work. The gate was revised to the measured, stable values above and the original 150 ms / 50 ms values remain the post-0.3.0 row-windowing goal (AR-40).

Fit after ​

The two-dimensional fit landed after the performance work. It is measured by tests/e2e/fit.spec.ts on the same reference host:

Host regionWindowProfileVisible lanesCell minimumPage scrollComponent scroll
1280 × 80014 monthscomfortable125.6 × 51.9 pxnonenone
1440 × 90014 monthscomfortable128.8 × 59.1 pxnonenone
1024 × 76812 monthsdense124 px floornonenone

The three screenshots are in the plan evidence (fit-1280x800.png, fit-1440x900.png, fit-1024x768.png). The benchmark route pins fit: "none" so the Phase 0/Phase 1 numbers stay comparable. Print uses its own comfortable geometry and is unaffected.

Free for internal use. Built with VitePress, Storybook and TypeDoc.