From 73b7602b7948fe4b459f4344f091910297d4a107 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 11:25:20 -0300 Subject: Term: paint only the view's rows the body shows (docs/next-terminal.md, Phase 1 as built): Term.paint takes the first row, and ansi.recolor walks the body once first for the rows its grid lines and an edit copy's lines stand over, so a pane shorter than its terminal (perf's render gesture: a 3-row shell strip beside the file, its terminal still 118x37 until the next update resizes it to 118x2) no longer paints 37 rows of cells (4,366 Painted, 20 bytes each, 87 KB a frame) to show 2, as Phase 0's walk never did; render on medium, best of ten, back to back against the tree before: tui Debug 126/124/127 -> 81/82/81 us, gui Debug 128/129/124 -> 82/83/82, tui ReleaseFast 110/107/112 -> 75/74/74 (the old baselines: 81, 81, 73), 0.72M instructions:u a frame fewer, every other gesture unchanged; perf --terminal-mib 8 and 32 (instructions:u, 3 runs each): 3,928.7M -> 3,928.5M and 13,219.2M -> 13,217.9M; the perf baselines recorded anew in the three shapes (Zig 0.17.1, harness aed36aceb98afadd), so unit-test's perf check passes again; tui core-test 811/950 (139 skipped), shell-test 993/996, term-test 15/15, pane-test 180/181, kitty-test 45/45, behaviour-test 269/273 (the four addon ABI tests the base fails), process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's), replicas pass (checked/wrong 0), image-harness and kitty-harness pass, unit-test 1528/1536 (the four addon tests); gui core-test 811/950, image-harness and kitty-harness pass, unit-test 1587/1595 (the four addon tests) --- src/Term.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Term.zig') diff --git a/src/Term.zig b/src/Term.zig index cf94c6d5..441280ee 100644 --- a/src/Term.zig +++ b/src/Term.zig @@ -342,10 +342,10 @@ pub fn spanColor(f: *Filter, color: plain.Color, is_bg: bool) plain.Color { // images as placements; which of the body's rows they stand under is the // core's (src/ansi.zig). -/// Its view's rows as cells in the theme's colours, through the theme's -/// filter when the pane has it on. -pub fn paint(s: *State, ink: *const Ink, palette: *FilterPalette, filtered: bool, cols: u16, cells: []Painted, rows: []PaintedRow) void { - the().paint(s.impl, ink, palette, filtered, cols, cells, rows); +/// Its view's rows from `first`, `rows.len` of them, as cells in the +/// theme's colours, through the theme's filter when the pane has it on. +pub fn paint(s: *State, ink: *const Ink, palette: *FilterPalette, filtered: bool, first: u16, cols: u16, cells: []Painted, rows: []PaintedRow) void { + the().paint(s.impl, ink, palette, filtered, first, cols, cells, rows); } /// Its kitty graphics over the body's rows, as placements. -- cgit v1.3