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
1 month ago
..
cache util/cache: fix missing interface methods (#11275) 4 months ago
cibuild all: update copyright and license headers 1 year ago
clientmetric util/clientmetric: allow client metric values to be provided by a function 1 year ago
cloudenv util/cloudenv: add support for DigitalOcean 5 months ago
cmpver util/cmpver: add Less/LessEq helper funcs 4 months ago
codegen all: use Go 1.22 range-over-int 2 months ago
cstruct all: use Go 1.22 range-over-int 2 months ago
ctxkey all: use reflect.TypeFor now available in Go 1.22 (#11078) 5 months ago
deephash all: use Go 1.22 range-over-int 2 months ago
dirwalk all: use tstest.Replace more 1 year ago
dnsname all: use Go 1.22 range-over-int 2 months ago
execqueue control/controlclient,util/execqueue: extract execqueue into a package 5 months ago
expvarx all: use Go 1.22 range-over-int 2 months ago
fastuuid all: use Go 1.22 range-over-int 2 months ago
goroutines util/goroutines: let ScrubbedGoroutineDump get only current stack 1 year ago
groupmember util/groupmember: fail earlier if group doesn't exist, use slices.Contains 8 months ago
hashx all: use Go 1.22 range-over-int 2 months ago
httphdr util/httphdr: add new package for parsing HTTP headers (#9797) 9 months ago
httpm util/httpm: don't run test if .git doesn't exist 7 months ago
jsonutil all: use Go 1.22 range-over-int 2 months ago
limiter all: use Go 1.22 range-over-int 2 months ago
lineread all: update copyright and license headers 1 year ago
linuxfw util/linuxfw: fix IPv6 availability check for nftables (#12009) 1 month ago
lru util/lru: add Clear method 1 month ago
mak various: add golangci-lint, fix issues (#7905) 1 year ago
multierr all: use Go 1.22 range-over-int 2 months ago
must all: update copyright and license headers 1 year ago
nocasemaps all: use Go 1.22 range-over-int 2 months ago
osdiag ipn/local: log OS-specific diagnostic information as JSON (#11700) 2 months ago
osshare all: update copyright and license headers 1 year ago
osuser util/osuser: add unit test for parseGroupIds 2 months ago
pidowner all: use Go 1.22 range-over-int 2 months ago
pool util/pool: add package for storing and using a pool of items 1 month ago
precompress all: update copyright and license headers 1 year ago
progresstracking ipn/localapi: add support for multipart POST to file-put 3 months ago
quarantine all: update copyright and license headers 1 year ago
race all: use Go 1.22 range-over-int 2 months ago
racebuild all: update copyright and license headers 1 year ago
rands util/rands: add Shuffle and Perm functions with on-stack RNG state 5 months ago
reload util/reload: add new package to handle periodic value loading 3 months ago
ringbuffer all: use Go 1.22 range-over-int 2 months ago
set util/set: add Of variant of SetOf that takes variadic parameter 2 months ago
singleflight all: use Go 1.22 range-over-int 2 months ago
slicesx util/slicesx: add AppendMatching 2 months ago
syspolicy all: do not depend on the testing package 1 month ago
sysresources util/sysresources, magicsock: scale DERP buffer based on system memory 1 year ago
systemd all: update copyright and license headers 1 year ago
testenv util/testenv: add new package to hold InTest 11 months ago
topk all: use Go 1.22 range-over-int 2 months ago
truncate util/truncate: support []byte as well (#11614) 3 months ago
uniq all: use Go 1.22 range-over-int 2 months ago
vizerror util/vizerror: add As function to get wrapped Error 1 year ago
winutil util/syspolicy: add ReadStringArray interface (#11857) 2 months ago
zstdframe all: use Go 1.22 range-over-int 2 months ago