Files
magpie/internal
yetone ce20d5658f provider: Catalog's list is made once with room for every entry
catalogKeeping cloned the groups' entries at their size and grew the
list by append for every provider's model, about twice the list it
gave. It is now made once with room for the groups and every entry.

Real accounts (sandbox copy of the owner's HOME, network blocked), 40
polls of /api/state, /api/providers and drift, pprof alloc_space
between two heap snapshots, bb478f0e5 (mshare) vs a build with this and
the next commit (mall):
  catalogKeeping flat 21.1 MB -> 13.5 MB, cum 23.7 MB -> 14.0 MB
  /api/state and drift bodies byte-identical, /api/providers equal but
  for `fetched` and `lapsed` (a refused refresh in the blocked sandbox)
  the total went 584 -> 613 MB, the rise in paths neither commit
  touches (providerInfoWith +16 MB, agentFields +9 MB): runs of the
  same build vary that much

TestCatalogMadeOnce: a 400-model provider, the catalog held; making it
allocates under 1.5x the list. Broken by hand on mote (the clone put
back): "a catalog of 595200 bytes allocated 1563137 to make".

Run on mote at this tree plus the next commit: gofmt; go vet darwin and
windows (provider, gui, agent); GOOS=linux go vet ./internal/provider
ok; the new test with TestCatalogKeptAcrossRequests and
TestCatalogForKeptAcrossPolls 3/3 ok; go test ./internal/provider ok
(118s); go test ./internal/gui: the known reds #4514, #3949 and
TestColdTurnsTaken (#4510, 0.00s; passes alone 3/3 and in the next
full gui run).
Not run: the full ./... suite.
2026-11-01 06:16:35 +08:00
..
…
…
…
…
…
…