b5adaa8bd read Codex's sessions folders with dirent.Stats, and measured
on a real-account HOME it allocated about as much as the walk it
replaced (dirent.entry and nameOf 4.1 MB of 12.7 MB in 4 idle minutes):
Stats copies every name and builds a listing, for a check that keeps
none of it.
dirent.Each gives a callback each entry's name, in getattrlistbulk's
buffer, and its Stat, and stops when told; stats is now built on the
same reader. codexSessionsQuietListed makes a path for each folder and
nothing for a file.
Run:
- mote: go test -count=1 ./internal/dirent ./internal/sessions ok;
./internal/provider ok (141s); GOOS=windows and GOOS=linux -tags nogui
go vet ./internal/dirent ./internal/provider ok; gofmt clean
- xiaomi-gpu (Windows): -run 'TestEach|TestCodexSessionsQuiet' ok
Broken by hand: Each copying each name (string(name)), and
TestEachIsLstatWithNothingMade is red with 302 allocations for 301
entries.