docs(research): wrapped-text filter perf-fix investigation — hotspot identified, fix queued#145
Merged
Merged
Conversation
…hotspot identified, fix queued) First flame-graph diagnostic using the new CDP-tracing harness (PRs #143 + #144). Identifies getEstimatedRowHeightSignature as the leading user-code hotspot (~1.6-2.0 ms self, ~2% of trace window). Speculative lazy-signature fix tried in this session made the metric worse because columns-ref instability multiplies the signature cost — reverted. Memo queues a follow-up that targets the columns-ref stability at the grid-core boundary. Ships: - scripts/analyze-cdp.mjs — sourcemap-resolving CDP-trace analyzer - apps/bench/vite.config.ts — build.sourcemap: true for attribution - source-map devDep - research memo No production code change. Quality wedge untouched. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Vercel preview readyPreview: https://pretable-pfliq8g53-cacheplane.vercel.app Updated automatically by the |
5 tasks
blove
added a commit
that referenced
this pull request
May 18, 2026
…o PR #145 (#146) 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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First flame-graph diagnostic using the new CDP-tracing harness (PRs #143 + #144). Identifies
getEstimatedRowHeightSignature(`packages/renderer-dom/src/create-renderer.ts`) as the leading user-code hotspot at ~1.6–2.0 ms self-time (~2% of the 95 ms sample window).Verdict: no production code change. A speculative "lazy-signature" fix attempted in this session made the metric worse (1.9 ms → 2.6 ms) because columns-ref instability during the run multiplies the signature cost — reverted. The investigation queues a follow-up that targets columns-ref stability at the grid-core boundary.
What ships
Top hotspot (sourcemap-resolved, n=1 baseline)
```
Total sample time: 87.82 ms
41485μs (47.2%) (program) native overhead
11847μs (13.5%) (idle) paint-wait
3903μs ( 4.4%) get clientWidth forced reflow
1911μs ( 2.2%) getEstimatedRowHeightSignature ← leading user-code hotspot
1540μs ( 1.8%) (anon) packages/react/dist/index.mjs:29
1063μs ( 1.2%) (garbage collector)
927μs ( 1.1%) W6 packages/core/dist/index.mjs:69
```
Why no fix shipped
The trace surfaces the hotspot but not a confident single-line fix. The leading hypothesis — that the per-row signature cost is wasted because `cached.columnsRef === columns` should hit the fast path — would only matter if columns ref were stable, which the trace suggests it isn't. Fixing that root cause (likely in `packages/grid-core/src/create-grid-core.ts` where `options = { ...options, columns: nextColumns }` may fire spuriously) needs more instrumentation than fits one PR. Better to ship the tooling + honest analysis than a guess.
What's NOT in this PR
Gates
Follow-up
A separate PR after this lands should: add a counter probe to `estimateRowHeight` confirming how often the slow path fires, find the grid-core mutation that emits a new `options.columns` reference during filter trigger, and stabilize it. Expected delta: 1–2 ms on filter-text / sort / filter-metadata — enough to bring all three under the 16 ms budget.
🤖 Generated with Claude Code