You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[perf] Terminal stream events lack client-side batching before xterm.write() #2241
The backend PTY output is well-batched at ~30Hz (pty-subprocess.ts, 32ms flush interval with 128KB cap). However, on the renderer side, each stream event from the tRPC subscription calls xterm.write() individually without further batching:
// Terminal.tsx line 262-268electronTrpc.terminal.stream.useSubscription(paneId,{onData: (event)=>{handleStreamData(event);// writes to xterm per-message},});
When agents produce rapid output (Codex streaming, Claude Code tool results, npm install logs), the renderer processes each IPC message as a separate xterm.write() call. Each call can trigger:
xterm parser processing
WebGL texture atlas updates
Potential layout recalculations
Native terminals batch rendering at the display refresh rate. xterm.js does have internal write buffering, but coalescing writes before they enter xterm's pipeline would reduce overhead further.
Suggested Fix
Add a client-side write coalescing buffer using requestAnimationFrame:
Closing as a duplicate of #5602, the consolidated tracker for stale performance issues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5602 and we'll reopen.
Activity
fix: solve #2241 — coalesce terminal stream writes per animation frame
fix: solve #2244 — Terminal React.memo and xterm write coalescing
perf(terminal): coalesce PTY output into one xterm.write per animatio…
Kitenite commentedon Jul 11, 2026
Closing as a duplicate of #5602, the consolidated tracker for stale
performanceissues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5602 and we'll reopen.