Files
magpie/internal
yetone baef679f29 sessions: every other reader of a session file sizes its buffer by what is left of it, as scanAt does (#2776)
d7e02ae08 sized scanAt's buffer by the rest of the file. The other line
readers of a session file still took 1 MiB per file read:
- readMiniMaxCalls, readAgyCalls and readWorkBuddyCalls (WorkBuddy and
  CodeBuddy Code), which read a changed file whole;
- scanFrames, dsh's packed (.zstd) sessions, read on from a frame;
- mayHold, a search's first look at each file.
(calls_pi, calls_kimi, calls_dsh and dsh.go no longer hold one since
the incremental readers before a77f6ae16.) Each now takes
scanBuffer(f, off): the rest of a plain file plus one byte, 16 KiB to
1 MiB. ReadBytes and readFrame read a line or frame longer than the
buffer whole, as before; a packed WorkBuddy file (a zstd stream, not
an *os.File) keeps 1 MiB.

TestReadersOfASmallFileTakeASmallBuffer reads a two-line file 50 times
through each of the five and allows 256 KiB per read. With the five
readers put back (the test kept): red in all five, 1,049,161 (minimax),
1,049,271 (agy), 1,049,256 (workbuddy), 1,068,296 (frames) and
1,056,984 (search) bytes per read.

Not measured on the 600k sandbox: it holds no MiniMax, agy, WorkBuddy or
dsh sessions, so the saving there is the test's: ~1 MiB per file each
time one of these is read again.

Full suite on this series' final tree (aa678b482 before this note was
added), rebased on origin/main f76201a84: go test -p 4 ./... -timeout
45m, exit 0, 64 packages ok and none failed (gateway 1783 s, gui 361 s),
41 minutes at load ~190-200. gofmt -l: no files. go vet: darwin, linux
(-tags nogui) and windows exit 0. The GUI suite wasn't run: no file
under internal/gui/assets changed.
2026-10-19 14:34:18 +08:00
..
…
…