From 894ddbe9bcf2bbd1da3af0429b6ed9550c0d4ce3 Mon Sep 17 00:00:00 2001 From: gbc dev Date: Sat, 4 Jul 2026 22:39:34 +0200 Subject: renderer: inter-frame diffing to minimize terminal output Only cells that changed since the previous frame are redrawn, using cursor positioning to skip unchanged runs. Static screens write nothing after the first frame (~108x reduction on acid2). SIGWINCH forces a full repaint. Verified pixel-exact against the framebuffer (11520/11520 cells, 0 mismatch). --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index dea2d5c..947211d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,13 @@ codes and the Unicode upper-half-block trick (`▀`): each character cell packs two vertical pixels (foreground = top pixel, background = bottom pixel), giving a 160×144 GB screen in 160×72 terminal cells. +To keep terminal load low, output is minimized two ways: SGR color escapes +are only emitted when the fg/bg changes, and **inter-frame diffing** redraws +only the cells that changed since the previous frame (jumping over unchanged +runs with `ESC[row;colH`). A fully static screen writes nothing after the +first frame; on the acid2 screens this cut output from ~7.1 MB to ~65 KB +over 2 s (~108×). Terminal resize (`SIGWINCH`) triggers a full repaint. + ## Build & run ```sh -- cgit v1.3.1-sl0p