You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/portlist
Brad Fitzpatrick 036f70b7b4 portlist: refactor, introduce OS-specific types
Add an osImpl interface that can be stateful and thus more efficient
between calls. It will later be implemented by all OSes but for now
this change only adds a Linux implementation.

Remove Port.inode. It was only used by Linux and moves into its osImpl.

Don't reopen /proc/net/* files on each run. Turns out you can just
keep then open and seek to the beginning and reread and the contents
are fresh.

    name                    old time/op    new time/op    delta
    GetListIncremental-8    7.29ms ± 2%    6.53ms ± 1%  -10.50%  (p=0.000 n=9+9)

    name                   old alloc/op   new alloc/op   delta
    GetListIncremental-8    1.30kB ±13%    0.70kB ± 5%  -46.38%  (p=0.000 n=9+10)

    name                  old allocs/op  new allocs/op  delta
    GetListIncremental-8      33.2 ±11%      18.0 ± 0%  -45.82%  (p=0.000 n=9+10)

Updates #5958

Change-Id: I4be83463cbd23c2e2fa5d0bdf38560004f53401b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2 years ago
..
clean.go portlist: normalise space delimited process names (#5634) 2 years ago
clean_test.go portlist: normalise space delimited process names (#5634) 2 years ago
netstat.go portlist: update some internals to use append-style APIs 2 years ago
netstat_exec.go portlist: update some internals to use append-style APIs 2 years ago
netstat_test.go portlist: refactor, introduce OS-specific types 2 years ago
poller.go portlist: refactor, introduce OS-specific types 2 years ago
portlist.go portlist: refactor, introduce OS-specific types 2 years ago
portlist_ios.go portlist: update some internals to use append-style APIs 2 years ago
portlist_js.go portlist: update some internals to use append-style APIs 2 years ago
portlist_linux.go portlist: refactor, introduce OS-specific types 2 years ago
portlist_linux_test.go portlist: refactor, introduce OS-specific types 2 years ago
portlist_macos.go portlist: update some internals to use append-style APIs 2 years ago
portlist_other.go portlist: update some internals to use append-style APIs 2 years ago
portlist_test.go portlist: refactor, introduce OS-specific types 2 years ago
portlist_windows.go portlist: update some internals to use append-style APIs 2 years ago