From e64bd853c33bce38f91c9103c0afceb690333585 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 20:58:22 -0300 Subject: Band: one band layer a surface, not one a pane (a fix on top of item 3, vnqmzpqs, frozen): the cost at rest of the walk UI: every frame makes many a temporary Surface (renderHeaderLayer one a header row, joinPaneTag one a tag, body_layer one a pane), each a whole Surface whose tag_layers array is default-initialised by a copy, and BAND_LAYER_BASE + MAX_PANES had added 64 layers to it: about 4 KB more copied a temporary, the +3,300 instructions an image-frame (+0.94%) and +7,000-9,000 a key or render cell, in compiler_rt memcpy under draw.renderHeaderLayer and draw.joinPaneTag (perf record of image-frame, main against moosvmpn: memcpyFast +2,650 a frame, its block loop, memcpy.zig:136-138); a view has one tag out of rest (SPEC ยง3.4: the keyboard's; Band.takes is 0 for every other pane), so one band layer (root.zig BAND_LAYER, the index, in place of the working name BAND_LAYER_BASE) and Band.bandLayer asks its pane id; MEASURED (pardes-perf ReleaseFast gui, per-op instructions, main e9f3712c -> moosvmpn -> this): image-frame small 351,781 -> 355,074 -> 352,716 (+0.27% on main), render small 11,351,038 -> 11,360,330 -> 11,353,581 (+0.02%), key-down small 9,932,384 -> 9,939,622 -> 9,932,840 (+0.005%), client-key-down small 1,915,270 -> 1,924,015 -> 1,921,482 (+0.32%, the rest there not traced: a profile points at the digest walk, walk.hash, which View.tag_state joined); core-test 1006/1173 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- core/Band.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/Band.zig') diff --git a/core/Band.zig b/core/Band.zig index 8a433243..9fa204ee 100644 --- a/core/Band.zig +++ b/core/Band.zig @@ -415,8 +415,8 @@ pub fn wordAt(p: *Pardes, arena: std.mem.Allocator, id: usize, y: u16, col: u16) } fn bandLayer(p: *Pardes, id: usize) ?*pardes.Layer { - const layer = &p.surface.tag_layers[pardes.BAND_LAYER_BASE + id]; - return if (layer.rows > 0 and layer.kind == .band) layer else null; + const layer = &p.surface.tag_layers[pardes.BAND_LAYER]; + return if (layer.rows > 0 and layer.kind == .band and layer.id == id) layer else null; } fn layerRow(arena: std.mem.Allocator, layer: *const pardes.Layer, row: usize) ![]const u8 { -- cgit v1.3