File: src/server/server.zig:2737-2780 Severity: MEDIUM Status: ✅ FIXED
In renderToDisplayClient, for each pane in each display client:
This happens even when the format string is static (e.g. default “#I”) and produces identical output every render.
With 4 panes and 2 display clients, that is 8 context allocations + 8 expand allocations per render.
Fix: Cache the expanded border format per pane. Store expanded_border: ?[]const u8 on Pane (owned, freed on deinit). Only re-expand when the option changes (track via a generation counter or dirty flag on the option). The context can also be reused — store a single Context on Server and clear it per-use instead of creating/destroying.