frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: React isn't the terminal UI bottleneck, the output pipeline is

3•nathan-cannon•3h ago
Anthropic rewrote Claude Code's terminal renderer and found that React wasn't the problem. Ink's line-level rewriting was. I built their approach into a standalone library.

CellState uses a custom React reconciler that renders directly to a cell grid and diffs frame-by-frame at the cell level. You keep native terminal behavior (scrolling, text selection, Cmd+F) because it runs inline instead of alternate screen.

React's reconciler only touches the subtree that changed, and the cell diff only covers the viewport, not the full scrollback.

At 250 messages (33KB of content), a single cell update writes 34 bytes to the terminal regardless of content size. Ink writes 41,955 bytes for the same change. The full rendering pipeline (reconciliation, layout, rasterize, cell diff) takes 2.54ms vs Ink's 36.93ms.

Benchmarks and methodology: https://github.com/nathan-cannon/tui-benchmarks

https://github.com/nathan-cannon/cellstate