Skip to content

feat(bench): interaction-window slicing for CDP traces + correction to PR #145#146

Merged
blove merged 1 commit into
mainfrom
bench-cdp-window-slicing
May 18, 2026
Merged

feat(bench): interaction-window slicing for CDP traces + correction to PR #145#146
blove merged 1 commit into
mainfrom
bench-cdp-window-slicing

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 18, 2026

Summary

  • Adds three `performance.mark` calls to bench-runtime (`pretable.interaction.start`, `.firstFrame`, `.settled`) and `blink.user_timing` to the CDP categories list, so captured traces include the interaction window bounds.
  • Extends `scripts/analyze-cdp.mjs` with `--window=interaction|settle|full`. Default remains `full` for backwards compat.
  • Corrects PR docs(research): wrapped-text filter perf-fix investigation — hotspot identified, fix queued #145's misattribution. With the new slicing, `getEstimatedRowHeightSignature` (F8) does not appear in the interaction-window top-26 hotspots — its full-trace cost was during initial mount (3000-row cache fill), not the filter trigger.

What the sliced trace shows (n=1)

Window: interaction (6.97 ms)
Total sample time in window: 5.26 ms across 26 unique nodes

Top 5 by SELF time (sourcemap-resolved):
  1127μs  (21.4%)  (program)                                  native overhead
   802μs  (15.3%)  matchesFilters  packages/core/dist/index.mjs:69
   409μs  ( 7.8%)  (anon) packages/react/dist/index.mjs:29
   275μs  ( 5.2%)  u8 packages/react/dist/index.mjs:17
   272μs  ( 5.2%)  Hd react-dom-client.production.js:13346

The real interaction-window hotspot is `matchesFilters` (`packages/grid-core/src/derived-rows.ts:73`) — lowercasing every cell value on every filter call across all 3000 source rows. ~800μs of the 6.97 ms window.

What's NOT in this PR

Lesson saved to memory

"Always slice CDP traces to the interaction window before naming a hotspot — full-trace view is dominated by mount-time work that doesn't count against `interaction_latency_ms`."

Gates

  • `pnpm -w typecheck` — passes
  • `pnpm -w test` — 191 / 191 pass
  • `pnpm -w lint` — passes
  • `pnpm format` — clean
  • No `packages/` source change. Quality wedge untouched.

🤖 Generated with Claude Code

…o PR #145

Adds three performance.mark calls to bench-runtime (interaction.start,
.firstFrame, .settled) and `blink.user_timing` to the CDP categories
list, so traces include the interaction window bounds. Extends
scripts/analyze-cdp.mjs with --window=interaction|settle|full;
default remains full for backwards compat.

Findings: with interaction-window slicing, the leading hotspot for
filter-text / S2 / hypothesis is `matchesFilters`
(packages/grid-core/src/derived-rows.ts:73) at ~800μs / 15% of the
6.97 ms interaction window. PR #145's `getEstimatedRowHeightSignature`
hypothesis was a full-trace artifact dominated by initial-mount work
(3000-row cache fill). Correction memo at
docs/research/2026-05-16-bench-cdp-window-slicing-correction.md
queues the lowercase-cache fix as a clean follow-up.

No production code change. Quality wedge untouched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@blove blove enabled auto-merge (squash) May 18, 2026 19:32
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pretable Ready Ready Preview, Comment May 18, 2026 7:33pm

@blove blove merged commit 8df2f6c into main May 18, 2026
13 checks passed
@blove blove deleted the bench-cdp-window-slicing branch May 18, 2026 19:35
@github-actions
Copy link
Copy Markdown
Contributor

Vercel preview ready

Preview: https://pretable-d7v8igkli-cacheplane.vercel.app
Commit: bbdf576641f9eb2ad9a7aced0f6a1a9f7dfd69c9

Updated automatically by the deploy-preview job.

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