tailscale/portlist
Brad Fitzpatrick db2cc393af util/dirwalk, metrics, portlist: add new package for fast directory walking
This is similar to the golang.org/x/tools/internal/fastwalk I'd
previously written but not recursive and using mem.RO.

The metrics package already had some Linux-specific directory reading
code in it. Move that out to a new general package that can be reused
by portlist too, which helps its scanning of all /proc files:

    name                old time/op    new time/op    delta
    FindProcessNames-8    2.79ms ± 6%    2.45ms ± 7%  -12.11%  (p=0.000 n=10+10)

    name                old alloc/op   new alloc/op   delta
    FindProcessNames-8    62.9kB ± 0%    33.5kB ± 0%  -46.76%  (p=0.000 n=9+10)

    name                old allocs/op  new allocs/op  delta
    FindProcessNames-8     2.25k ± 0%     0.38k ± 0%  -82.98%  (p=0.000 n=9+10)

Change-Id: I75db393032c328f12d95c39f71c9742c375f207a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-11-05 16:26:51 -07:00
..
clean_test.go portlist: normalise space delimited process names (#5634) 2022-09-15 12:17:31 +02:00
clean.go portlist: normalise space delimited process names (#5634) 2022-09-15 12:17:31 +02:00
netstat_test.go portlist: add macOS osImpl, finish migration to new style 2022-11-04 10:58:23 -07:00
netstat.go portlist: add macOS osImpl, finish migration to new style 2022-11-04 10:58:23 -07:00
poller.go portlist: add macOS osImpl, finish migration to new style 2022-11-04 10:58:23 -07:00
portlist_linux_test.go util/dirwalk, metrics, portlist: add new package for fast directory walking 2022-11-05 16:26:51 -07:00
portlist_linux.go util/dirwalk, metrics, portlist: add new package for fast directory walking 2022-11-05 16:26:51 -07:00
portlist_macos.go portlist: add macOS osImpl, finish migration to new style 2022-11-04 10:58:23 -07:00
portlist_test.go portlist: add a test that verifies changes are picked up over time 2022-10-23 22:02:22 -07:00
portlist_windows.go portlist: add macOS osImpl, finish migration to new style 2022-11-04 10:58:23 -07:00
portlist.go portlist: refactor, introduce OS-specific types 2022-10-23 20:29:23 -07:00