Files
magpie/internal/usage
yetone acced81418 usage: Codex effort read back shares its model and effort names (#2278)
effortDiskRead decoded every saved (model, effort) pair with its own copy
of both strings, so a few names were held thousands of times in the kept
Codex effort sums. The read now hands each entry the first copy of its
name.

Measured on mote, acctp real-account sandbox (17k chunks), pageheap.sh,
w53v (743001128) against w54v (this), alternating, two runs each:
- heap profile inuse_space cum: CodexModelEffort 4.60 MB -> 2.01 MB,
  effortDiskEntries 2.50 MB -> 1.00 MB
- liveHeap 78.38/77.86 MB -> 78.02/78.68 MB, Footprint 131/122 -> 126/130 MB:
  run-to-run noise (~1 MB) hides the 2.6 MB at this level
- CPU at mark unchanged (2.23-2.66 s both)

Run (mote, at this tree): go vet ./internal/usage; go test ./internal/usage
(ok, 59s). Broken by hand (intern removed): TestCodexEffortNamesReadOnce
red, "each entry has its own copy of a name".
Not tried: Windows/Linux (no OS-specific code).
2026-11-13 13:12:12 +08:00
..