ink icon indicating copy to clipboard operation
ink copied to clipboard

perf: use caches to speed up output generation

Open andyburris opened this issue 2 weeks ago • 2 comments

Really only noticeable for huge terminals so hard to use the current benchmarks, but anecdotally on my 150x200 terminal it's sped renders up from ~40ms to ~9ms, so almost 5x faster. Presumably it'd be more of a speedup the larger the terminal gets.

All tests (that were passing on current master) are passing.

andyburris avatar Dec 05 '25 22:12 andyburris

Output is recreated on every render, so it's unclear to me why this actually improves performance, unless the output has duplicated lines.

sindresorhus avatar Dec 08 '25 20:12 sindresorhus

I think because there's a lot of redundant processing even within a single output frame. For example:

andyburris avatar Dec 08 '25 21:12 andyburris