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 120273d7f6 portlist: document, clean up, fix an open fd spike, optimize a bit
I noticed portlist when looking at some profiles and hadn't looked at
the code much before. This is a first pass over it. It allocates a
fair bit. More love remains, but this does a bit:

name       old time/op    new time/op    delta
GetList-8    9.92ms ± 8%    9.64ms ±12%     ~     (p=0.247 n=10+10)

name       old alloc/op   new alloc/op   delta
GetList-8     931kB ± 0%     869kB ± 0%   -6.70%  (p=0.000 n=10+10)

name       old allocs/op  new allocs/op  delta
GetList-8     4.59k ± 0%     3.69k ± 1%  -19.71%  (p=0.000 n=10+10)

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
..
netstat.go portlist: add a lint ignore for unused function. 5 years ago
netstat_test.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
poller.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
portlist.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
portlist_darwin.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
portlist_linux.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
portlist_other.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
portlist_test.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago
portlist_windows.go portlist: document, clean up, fix an open fd spike, optimize a bit 5 years ago