perf(widgets): lazy-load widget editors to keep undici out of the render path - #3
Merged
Merged
Conversation
…wiring - terminal: check the ancestor TTY before reassigning pid so each loop iteration reads as "one ps answer, one pid"; no call-order change - claude-service-status: cover the lazy proxy-agent branch with tests (agent attached when HTTPS_PROXY is set, absent otherwise), matching the usage-fetch proxy coverage Co-Authored-By: Claude Code <noreply@anthropic.com>
Extend the lazy TUI boundary from 35440e4 to widget editors: the registry previously initialized Ink's useInput/reconciler/Yoga graph on every piped render. Move editor implementations into lazy chunks and retain synchronous renderEditor APIs through React Suspense. Add an isolated startup regression check and wait for lazy editors in interaction tests.\n\nVerified: bun test (2361 pass), bun run lint, Node/Bun built renders and 13MB four-worker benchmarks. Node14 distribution build failure predates this change and is tracked separately in the perf verification report.
axisrow
force-pushed
the
perf/lazy-widget-editors
branch
from
September 25, 2026 12:54
bf1b26b to
d7b61f7
Compare
This was referenced Sep 25, 2026
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
Follow-up to PR #2 and upstream
35440e4(sirmalloc#575): the eleven widget-editor implementations move into lazy chunks loaded via Reactlazy/Suspense, while preserving the synchronousrenderEditorAPI. Render-time widget logic is unchanged; no new dependencies; the large diff is predominantly moving existing editor bodies.Effect on the built, no-proxy piped render path:
moduleLoadListThe eager editor → Ink
useInput→ reconciler → Yoga route that survived both upstream sirmalloc#575 and PR #2 no longer executes on render.Benchmark
13,009,445-byte synthetic transcript, 4 concurrent workers × 20 fresh processes each (one untimed warmup per worker), isolated
HOME/USERPROFILE/CLAUDE_CONFIG_DIR, no proxy vars,tput-supplied width. Shared development host, so prefer the final clean sequence over the faster exploratory batches (all trials committed indocs/performance-397-results.json):Final Node p50 regressed 1.8%, so no universal latency improvement is claimed. Earlier recorded batches averaged −14.5% (Node) / −15.8% (Bun) CPU/render. Output hashes are identical across all revisions (
454f8606…).Editor first-open can suspend briefly (~300 ms observed in tests).
Tests
bun test: 2361 passed / 0 failed (single final run); new fresh-process regression test asserts the widget-registry import stays undici-free; fixed-latency sleeps in glyph/locale/timezone tests replaced with first-lazy-frame waitsbun run lint: clean, no suppressionsbun run build: successful; built piped renders verified on Node and BunKnown blocker (pre-existing, deliberately out of scope)
docs/performance-397-verification.mddocuments that the distribution's Node 14 requirement is already broken on unmodified baseline: Bun does not lower??=/class-field syntax for--target-version=14, and installed manifests require Node ≥22 (chalk 6) / ≥20 (Ink 6.2.0). This PR adds no newer JS syntax or Node APIs.Artifacts
docs/performance-397-verification.md(adversarial verification of PR #2, verdict table),docs/performance-397-results.json(every 13 MB trial),scripts/benchmark-render.py(repro:CCSTATUSLINE_BENCH_DIR=/tmp/ccstatusline-bench python3 scripts/benchmark-render.py <node|bun> <dist.js> <label>).Related: #2, sirmalloc#397, upstream
35440e4(sirmalloc#575).🤖 Generated with Claude Code