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/util
Andrew Dunham 8e4a29433f util/pool: add package for storing and using a pool of items
This can be used to implement a persistent pool (i.e. one that isn't
cleared like sync.Pool is) of items–e.g. database connections.

Some benchmarks vs. a naive implementation that uses a single map
iteration show a pretty meaningful improvement:

    $ benchstat -col /impl ./bench.txt
    goos: darwin
    goarch: arm64
    pkg: tailscale.com/util/pool
                       │    Pool     │                   map                    │
                       │   sec/op    │     sec/op      vs base                  │
    Pool_AddDelete-10    10.56n ± 2%     15.11n ±  1%    +42.97% (p=0.000 n=10)
    Pool_TakeRandom-10   56.75n ± 4%   1899.50n ± 20%  +3246.84% (p=0.000 n=10)
    geomean              24.49n          169.4n         +591.74%

Updates tailscale/corp#19900

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: Ie509cb65573c4726cfc3da9a97093e61c216ca18
6 months ago
..
cache
cibuild
clientmetric
cloudenv
cmpver
codegen all: use Go 1.22 range-over-int 7 months ago
cstruct all: use Go 1.22 range-over-int 7 months ago
ctxkey
deephash all: use Go 1.22 range-over-int 7 months ago
dirwalk
dnsname all: use Go 1.22 range-over-int 7 months ago
execqueue
expvarx all: use Go 1.22 range-over-int 7 months ago
fastuuid all: use Go 1.22 range-over-int 7 months ago
goroutines
groupmember
hashx all: use Go 1.22 range-over-int 7 months ago
httphdr
httpm
jsonutil all: use Go 1.22 range-over-int 7 months ago
limiter all: use Go 1.22 range-over-int 7 months ago
lineread
linuxfw util/linuxfw: fix IPv6 availability check for nftables (#12009) 6 months ago
lru util/lru: add Clear method 6 months ago
mak
multierr all: use Go 1.22 range-over-int 7 months ago
must
nocasemaps all: use Go 1.22 range-over-int 7 months ago
osdiag ipn/local: log OS-specific diagnostic information as JSON (#11700) 7 months ago
osshare
osuser util/osuser: add unit test for parseGroupIds 7 months ago
pidowner all: use Go 1.22 range-over-int 7 months ago
pool util/pool: add package for storing and using a pool of items 6 months ago
precompress
progresstracking
quarantine
race all: use Go 1.22 range-over-int 7 months ago
racebuild
rands
reload util/reload: add new package to handle periodic value loading 8 months ago
ringbuffer all: use Go 1.22 range-over-int 7 months ago
set util/set: add Of variant of SetOf that takes variadic parameter 7 months ago
singleflight all: use Go 1.22 range-over-int 7 months ago
slicesx util/slicesx: add AppendMatching 7 months ago
syspolicy all: do not depend on the testing package 6 months ago
sysresources
systemd
testenv
topk all: use Go 1.22 range-over-int 7 months ago
truncate
uniq all: use Go 1.22 range-over-int 7 months ago
vizerror
winutil util/syspolicy: add ReadStringArray interface (#11857) 7 months ago
zstdframe all: use Go 1.22 range-over-int 7 months ago