perf(editor): highlight only affected code blocks - #253
Conversation
SWBaek
left a comment
There was a problem hiding this comment.
Independent Astra review of commit 1741332: no blocking findings; ready to merge.
This review was performed by a different Astra agent from the implementer, using the same repository owner's GitHub identity. It is recorded as a comment review, not represented as approval by a separate GitHub account.
Reviewed the complete diff, issue evidence, and regression tests. Canonical-step checks guard both mapping paths; change ranges are interpreted in each step's coordinate space; same-text replacement invalidates old spans; language/text checks and removing invalidated decorations before mapping prevent stale code-to-paragraph highlighting. Unknown custom steps rebuild fully. The ordinary paragraph proof and host-neutral boundaries remain intact.
Independent validation on Node 22.22.2 / npm 10.9.7:
- Both targeted test files passed: 21 tests.
- An additional reviewer oracle probe passed 4,573 comparisons covering exhaustive range boundaries in nested/empty code fixtures, deletion/text/same-slice/block replacements, inverse transactions, same-transaction forward/inverse sequences, and a custom replacement step reporting an empty map.
- All five CI jobs passed for this exact head: javascript, Chromium UI, Extension Host, and CLI packaging on Ubuntu and Windows. Reviewed the implementer's successful verify:all evidence as well.
Performance assessment: real mixed-corpus code edits reduce highlight calls from 250 to 1; paragraph edits/marks from 250 to 0. Non-ordinary transactions still scan the document. The optional ordinary-input release budget is not met: matched local baseline/candidate input p95 was 61.8/58.1 ms against 50 ms, with dispatch median 11.3/10.85 ms. This comparison does not show an ordinary-input regression, but does not establish a general latency guarantee or waive the existing budget.
Proceeding with the user-authorized squash merge, constrained to the reviewed head commit.
Summary
Editing one code block in a 250-block document previously re-highlighted all 250 blocks; formatting a paragraph did the same. The shared editor now maps unchanged syntax spans and highlights only affected blocks, with a full rebuild for unknown step implementations. Code edits make one highlight call and paragraph mark edits make zero.
Adds full-build oracle coverage for language changes, paste/delete, nested wrapping/lifting, split/join, Undo/Redo, composition and same-text replacement. Adds
npm run perf:browser -- --scenario=lowlightfor actual Chromium keyboard measurements. Before/after samples show dispatch medians of 70.2 → 57.5 ms for code input and 67.3 → 53.0 / 80.8 → 55.5 ms for paragraph scenarios. Non-ordinary transactions still scan the document; timing is local evidence rather than a new latency guarantee.Closes #247.
Validation
npm run check/npm run verify:fast(909 tests)npm run build:all(throughverify:all)npm run verify:all— fast checks, builds, 73 Chromium UI tests, VS Code Extension Host, VSIX and CLI packagingnpm run perf:browser -- --scenario=lowlight— 2 warmups + 7 measured edits per scenario, call-count gates passAdditional ordinary
rich-mixed-5ktiming gate: failed locally on both base and PR (input p95 61.8 / 58.1 ms vs 50 ms). The same-harness comparison shows no observed regression; the threshold remains unchanged.Contribution rights