Files
magpie/internal/usage
yetone ce0960b4ab usage: a first Requests build reads with four workers, not eight
A first build of the request rows runs on any upgrade that changes
internal/usage (the cache key hashes its source) and on a first install.
Each prefetchEach worker holds a whole file's calls while it reads, so
eight of them stacked up in the cold peak.

Measured on mote with a copy of the owner's real accounts and history
(HOME ~/r2278/acct, requests-v1.bin removed before each start), five
cold starts of each build alternated, physical footprint peak at 12s
(vmmap):
  eight workers: 248.3 259.1 252.1 257.5 276.1 MB (mean 258.6)
  four workers:  243.3 230.2 232.6 245.2 246.7 MB (mean 239.6)
Every four-worker run is below every eight-worker run. The build takes
the same time: the gctrace burst ends at 5.0/5.0/5.6/5.0/6.2s against
5.0/4.8/4.9/5.0/6.4s, and CPU in the first 12s is 6.7-7.6s for both.
The cache written is the same size (71,523,711 bytes) for both.

TestPrefetchEachMakeIsAReadersOwn counts four readers' makes now.

Run at this head (rebased on 8fe720453), on mote: gofmt -l clean,
go test ./internal/usage ok. go test ./internal/gui: red only in
TestCoreScriptBudget (#6116) and TestSettingsSaveKeepsWhatItDoesNotSend
(#6103), both red on main at 8fe720453 and filed; this change touches
no GUI file.
Not run: the full ./... suite.
2026-11-11 16:12:43 +08:00
..