A state was 424 bytes, so each one decodeCache and parseRead make took a
448-byte slot. HeadSize is the length of a head of headLen (256) bytes
at most; as an int32 beside CdRead it saves 8 bytes, and a state is 416,
32 bytes less held per session file (~0.58MB for 18k files).
Run (mote, real-account copy, idle 180s, network blocked):
- decodeCache's inuse 26.01MB -> 23MB, reflect.unsafe_New 15.51MB ->
12MB. The profile samples every 512KB, so more than the ~0.58MB the
size class accounts for is sampling, not this change.
- TestStateFitsItsSizeClass: green; red on the old int by hand ("a state
is 424 bytes, over the 416-byte size class").
- go test ./internal/sessions/ ok; go vet darwin, linux, windows ok;
gofmt clean. The cache's JSON keeps head_size as a number, so an old
cache reads as before.
Not tried: the full suite (state is unexported, only internal/sessions
reads it).