Skip to content

perf: coalesce redundant transcript paints during output bursts - #506

Open
raiseCatError wants to merge 1 commit into
devfrom
perf/20261025-runtime
Open

raiseCatError wants to merge 1 commit into
devfrom
perf/20261025-runtime

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Output bursts repaint and rewrap the transcript for every PTY chunk, making a 10,000-line command take ~29 seconds in the baseline workload. Coalesce only output-triggered paints within one display tick; keep parsing, terminal queries, passthrough and input/prompt/resize frames synchronous.

Pending mouse events resolve against the last displayed viewport; active selection drags retain synchronous output painting so release cannot copy an unseen redraw. The snapshot retains only visible rows. No shell bytes are discarded and no queue/input approval semantics change.

Measured on Apple M2 / 8 GiB / macOS 27 / Node 26.12, built CLI with disposable config/services:

  • 1,000 Unicode lines: Native median 349.30 → 124.70 ms; None 348.06 → 126.38 ms (11 warm samples/provider).
  • 10,000 lines: warm median 29,065.60 → 297.24 ms; sampled post-output frontend RSS 475.30 → 361.02 MiB (5 warm samples/variant). Every journaled line verified in order.
  • Alternating startup control shows no material startup gain/regression; no supported idle CPU/RSS gain. Peak profiled RSS was essentially unchanged; one profiled event-loop p95 sample worsened. Full data and limitations: docs/performance/2026-10-25-runtime.md.

Independent static review approved after pointer/selection findings were fixed. Focused production-path regressions pass. Full canonical npm run verify passed with two workers, private short T7 fixtures and explicit xterm-256color/truecolor capabilities (NO_COLOR unset). No tests excluded or assertions changed. Four-worker completion-helper failure and an invalid-color cancelled attempt are documented in the evidence. Existing Arcade disposal TODO and intermittent macOS read issue are not claimed fixed.

Physical Ghostty/Zed QA: NOT RUN. Check large Unicode output while typing, selection/copy during live redraw, detached scrolling/resizing, Ctrl+C/Ctrl+Z, fullscreen entry/return, NO_COLOR and Reduced Motion. Keep the issue open pending real terminal validation.

Refs #505

Do not merge automatically.

Exact-head CI: 792fb1ad7e687cc0e2e4e93af58029e59409b146 passed macOS/Ubuntu shards, Quality and Node 22 compatibility; aggregate CI green. Fedora/timing jobs were skipped by workflow conditions. CI run. PR remains unmerged.

Environment clarification: t7run supplies NODE_COMPILE_CACHE=/Volumes/T7Tmp/ai-dev/caches/node-compile; the original before/after runs inherited it. No OS-cache purge or true cold-start claim. The one four-worker completion capture failure returned zero after ~2.45 s, consistent with a helper deadline under load; its root cause is not proven. Focused and full two-worker reruns passed unchanged.

This branch has not been deployed

No deployments
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