From 24e74af419174fdaeaa363ec59b4688a9ba3aa37 Mon Sep 17 00:00:00 2001 From: Jon Ruttan Date: Wed, 4 Nov 2026 21:05:22 -0500 Subject: [PATCH] perf(line): the asm cache is in the image, not read at the first prompt The first Lexer make in a process imports x/tool/asm-cache, and python/line makes its lexer lazily at a terminal session's first prompt. Nothing imported the module where the image is written, so every terminal session read it from source under the numeric tower's reader: in x-os's container (a 3.7 GB podman VM) the banner printed, memory climbed past 1.4 GB, and the session was killed with no prompt. Piped sessions never make the lexer and were unaffected. x-lang's Lexer doc names this cost and this remedy. Co-Authored-By: Claude Opus 5.5 --- python/line.x | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/line.x b/python/line.x index ff4ef8d..b5b6a94 100644 --- a/python/line.x +++ b/python/line.x @@ -58,6 +58,11 @@ ; The editor. Imported here rather than left to the launcher so that its ; Line class exists when the completer is installed below. (import x/repl/line) +; The first Lexer make in a process imports the asm cache. Left to that make, +; it is read from source at a session's first prompt, under the numeric +; tower's reader: in a container of 4 GB that prompt never drew. Imported +; here, it is in the image. +(import x/tool/asm-cache) ; --- reading one line --------------------------------------------------------- ;