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/syncs
James Tucker e8f1721147 syncs: add ShardedInt expvar.Var type
ShardedInt provides an int type expvar.Var that supports more efficient
writes at high frequencies (one order of magnigude on an M1 Max, much
more on NUMA systems).

There are two implementations of ShardValue, one that abuses sync.Pool
that will work on current public Go versions, and one that takes a
dependency on a runtime.TailscaleP function exposed in Tailscale's Go
fork. The sync.Pool variant has about 10x the throughput of a single
atomic integer on an M1 Max, and the runtime.TailscaleP variant is about
10x faster than the sync.Pool variant.

Neither variant have perfect distribution, or perfectly always avoid
cross-CPU sharing, as there is no locking or affinity to ensure that the
time of yield is on the same core as the time of core biasing, but in
the average case the distributions are enough to provide substantially
better performance.

See golang/go#18802 for a related upstream proposal.

Updates tailscale/go#109
Updates tailscale/corp#25450

Signed-off-by: James Tucker <james@tailscale.com>
12 months ago
..
locked.go all: update copyright and license headers 3 years ago
locked_test.go all: update copyright and license headers 3 years ago
pool.go syncs: add generic Pool (#12759) 1 year ago
pool_test.go syncs: add generic Pool (#12759) 1 year ago
shardedint.go syncs: add ShardedInt expvar.Var type 12 months ago
shardedint_test.go syncs: add ShardedInt expvar.Var type 12 months ago
shardedmap.go syncs: add ShardedMap.Mutate 2 years ago
shardedmap_test.go syncs: add ShardedMap.Mutate 2 years ago
shardvalue.go syncs: add ShardedInt expvar.Var type 12 months ago
shardvalue_go.go syncs: add ShardedInt expvar.Var type 12 months ago
shardvalue_tailscale.go syncs: add ShardedInt expvar.Var type 12 months ago
shardvalue_test.go syncs: add ShardedInt expvar.Var type 12 months ago
syncs.go syncs: add MutexValue (#14422) 12 months ago
syncs_test.go syncs: add MutexValue (#14422) 12 months ago