almaProvidersSeen decoded Alma's providers list each time it was asked
past almaReadFor, on each poll of the Agents page. On the live magpie
(v0.1.2906) Alma's answer is 227 KB, and its json.Unmarshal was ~13 MB of
what an idle two minutes allocated (heap profile diff from
/v1/magpie/heap). The same bytes are now answered with the providers they
gave last time, by pointer or by bytes.Equal; changed bytes are decoded
as before.
Run (mote, at this tree):
- go vet ./internal/agent/, gofmt -l: clean
- go test -count=1 -timeout 45m ./internal/agent/: ok (216.6s)
- TestAlmaProvidersSeenDecodeOnce's new part (almaReadFor 0, AllocsPerRun of a
look) is green at most 400 allocs; with the bytes.Equal check removed
by hand it measures 7232 and goes red.
Not tried: a live Alma app against this build; the bytes compared are
what almaGet already returned.