Files
magpie/internal
yetone f8248ccd70 sessions: an unchanged folder's look allocates nothing (#2278)
readDirectory looked at each folder with os.Stat on every Sessions poll
to see whether its cached listing still held. os.Stat builds a FileInfo
and a name each time, ~6 MB per 40 polls on a real history. dirStat reads
the same mod time, size and kind with unix.Stat into a stack Stat_t;
other systems keep os.Stat.

Run (mica, at this tree): go vet ./internal/sessions for darwin, linux,
windows; GOOS=freebsd go build ./internal/sessions; go test ./internal/sessions
ok (61.8s). TestDirStatAsOSStat passes; with the old discovery.go it fails
("an unchanged folder's look allocated 2 times").

Real account (mote, 40 polls of /api/sessions): w8 34.16 MB allocated,
os.statNolog 6 MB; w9 31.28 MB, os.statNolog not in the top list.
2026-11-12 05:36:00 +08:00
..
…
…
…
…
…
2026-11-11 08:14:28 +08:00
…
…
…
…