partsOf, cellsBefore and heatDaysOf read each chunk through a chunkRows
that copied the chunk's whole string section first. What they keep is
unique's handles (a cell), a date made by Format and numbers (a day), so
the copy was thrown away chunk by chunk. They now read through
lentRows(), as newest and the Codex readers already do.
Run on mote:
- go test ./internal/usage/ -count=1 -timeout 45m: ok (40s).
- -race -count=3 on TestPartsReadStringsWhereDecoded,
TestRowBufferKeptPastCollections, TestRequestCells*, *Heat*, *PageSplit*: ok.
- TestPartsReadStringsWhereDecoded (new): 8 packed chunks, 1.1MB of
strings. With the three sites put back to `var rows chunkRows` by sed
it is red: partsOf 1,188,672 bytes, cellsBefore 1,197,568, heatDaysOf
1,187,616. Green with the change; the cells' names and the days' counts
are right after the buffer was decoded over again.
- Real history copy (66GB, ~12k session files), magpie web in a sandbox
HOME, heap profile 40s after start, two rounds each:
unpackReusing 183MB / 174MB before, 106MB / 113MB after;
partsOf 76MB / 78MB before, 55MB / 56MB after.
A warm poll of every page reads cached parts and is unchanged.
Not tried: the Windows and Linux boxes (no OS-specific code).