Performance and limits

omdsh treats terminal responsiveness as an architectural concern: linear session replay, per-block layout caching, coalesced streaming frames, and line-level terminal diffing keep long sessions and large previews responsive.

1. Practical limits you will notice in daily use

When content grows huge, omdsh enforces clear guardrails to protect terminal responsiveness and context budgets:

ScenarioBuilt-in guardrail and behavior
Long sessions (thousands of turns)Linear replay plus cached completed blocks mean typing and scrolling never re-format old turns. Run /compact when footer Ctx passes 75% to keep model latency low.
Large files & diffs (/diff)Loads 128 KiB initially and doubles with L (Load more) up to 4 MiB; open larger or binary files externally with O. Horizontal panning slices only visible rows on demand.
Very long streaming repliesDense deltas coalesce inside an 8 ms frame window and reuse already-committed Markdown prefix blocks across streaming appends, keeping even ~120K-char rich replies well within the frame budget unless link definitions or layout width change.
File recovery snapshots (Alt+R)Automatically skips capture if a file exceeds 128 MiB, a snapshot exceeds 1 GiB, or a workspace exceeds 10,000 entries so normal turns stay fast.
Images & archive exportsSingle image uploads cap at 20 MiB (oversized resolutions scale automatically); preview decoding caps at 32 MiB / 40 MP; /export archive caps at 64 MiB uncompressed.
tmux / multiplexer resizingCoalesces resize bursts before redrawing while preserving host scrollback; press Alt+L anytime to repaint the live viewport after reattaching.

2. Why it stays fast

  1. Linear-time session replay: Reconstructing durable logs uses a linear pass with a callId β†’ block index map so tool-heavy histories scale linearly rather than quadratically.
  2. Direct metering projections: Token counts, context pressure, and stats come straight from Harness projections instead of re-scanning event logs on every streaming token.
  3. Block and streaming caches: Completed Markdown, tool cards, sticky headers, and committed streaming Markdown prefixes cache formatted rows by identity and width, reused across streaming appends, typing, animations, and scrolling.
  4. Line-level differential output: Each frame writes only changed visible rows, minimizing terminal work and SSH bandwidth.

3. Measured benchmarks (2026-11-06)

Measured locally on Apple M5 Pro (48 GiB RAM, macOS, Node.js v24.18.0). Numbers isolate local TUI CPU work in milliseconds (excluding network, disk I/O, and terminal GPU painting):

WorkloadBefore p50After p50After p95Samples
Scroll 109,500-char Markdown preview (160Γ—50)21.9860.3830.45420
Pan 10,000-line source preview (45 visible rows)52.6180.2120.21610
Replay 10,000 turns with lifecycle events453.2032.5675.6517
Replay 20,000 turns with lifecycle events2074.1938.4428.6997
10,000-char rich streaming frame (80Γ—50)3.1231.9032.17115
50,000-char rich streaming frame (80Γ—50)16.0959.01711.16715
120,000-char rich streaming frame (80Γ—50)40.06421.97323.52215

Real PTY interaction samples on the same machine (built binary, mock LLM): cold start to interactive footer 697.4 ms median (~310 MiB RSS), keystroke response 1.08 ms, opening /help 4.20 ms, opening /tools 3.32 ms, and ~0.02 s CPU over 5 idle seconds after a turn.

4. Reproduce locally

Run the built-in benchmark suite from the repository root (scripts/benchmark-tui.mts):

pnpm install
pnpm benchmark:tui

The script reports CPU latency alongside terminal write counts and ANSI byte volume so regressions in complexity or output amplification are easy to catch.