mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
Three caching optimizations for the render pipeline: 1. FrameBuffer.width is now a stored property, recomputed only when lines mutates (didSet). Eliminates ~125 redundant ANSI-stripping regex runs per frame from repeated .width accesses. 2. strippedLength counts visible characters by subtracting ANSI match lengths instead of allocating an intermediate stripped string. 3. RenderLoop.render() calls terminal.getSize() once per frame instead of terminal.width + terminal.height (2 ioctl syscalls → 1). All 455 tests passing.