wireguard-go/device
Jason A. Donenfeld c3bde5f590 device: benchmark the waitpool to compare it to the prior channels
Here is the old implementation:

    type WaitPool struct {
        c chan interface{}
    }

    func NewWaitPool(max uint32, new func() interface{}) *WaitPool {
        p := &WaitPool{c: make(chan interface{}, max)}
        for i := uint32(0); i < max; i++ {
            p.c <- new()
        }
        return p
    }

    func (p *WaitPool) Get() interface{} {
        return <- p.c
    }

    func (p *WaitPool) Put(x interface{}) {
        p.c <- x
    }

It performs worse than the new one:

    name         old time/op  new time/op  delta
    WaitPool-16  16.4µs ± 5%  15.1µs ± 3%  -7.86%  (p=0.008 n=5+5)

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-03 16:59:29 +01:00
..
alignment_test.go device: use a waiting sync.Pool instead of a channel 2021-02-02 19:32:13 +01:00
allowedips.go global: bump copyright 2021-01-28 17:52:15 +01:00
allowedips_rand_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
allowedips_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
bind_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
constants.go global: bump copyright 2021-01-28 17:52:15 +01:00
cookie.go global: bump copyright 2021-01-28 17:52:15 +01:00
cookie_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
device.go device: tie encryption queue lifetime to the peers that write to it 2021-02-03 00:57:57 +01:00
device_test.go device: test that we do not leak goroutines 2021-02-03 00:57:57 +01:00
endpoint_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
indextable.go global: bump copyright 2021-01-28 17:52:15 +01:00
ip.go global: bump copyright 2021-01-28 17:52:15 +01:00
kdf_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
keypair.go global: bump copyright 2021-01-28 17:52:15 +01:00
logger.go global: bump copyright 2021-01-28 17:52:15 +01:00
misc.go global: bump copyright 2021-01-28 17:52:15 +01:00
mobilequirks.go global: bump copyright 2021-01-28 17:52:15 +01:00
noise-helpers.go global: bump copyright 2021-01-28 17:52:15 +01:00
noise-protocol.go global: bump copyright 2021-01-28 17:52:15 +01:00
noise-types.go global: bump copyright 2021-01-28 17:52:15 +01:00
noise_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
peer.go device: tie encryption queue lifetime to the peers that write to it 2021-02-03 00:57:57 +01:00
pools.go device: use a waiting sync.Pool instead of a channel 2021-02-02 19:32:13 +01:00
pools_test.go device: benchmark the waitpool to compare it to the prior channels 2021-02-03 16:59:29 +01:00
queueconstants_android.go global: bump copyright 2021-01-28 17:52:15 +01:00
queueconstants_default.go global: bump copyright 2021-01-28 17:52:15 +01:00
queueconstants_ios.go global: bump copyright 2021-01-28 17:52:15 +01:00
receive.go device: use new model queues for handshakes 2021-01-29 18:24:45 +01:00
send.go device: tie encryption queue lifetime to the peers that write to it 2021-02-03 00:57:57 +01:00
sticky_default.go device: do not include sticky sockets on android 2020-06-07 01:50:20 -06:00
sticky_linux.go global: bump copyright 2021-01-28 17:52:15 +01:00
timers.go global: bump copyright 2021-01-28 17:52:15 +01:00
tun.go global: bump copyright 2021-01-28 17:52:15 +01:00
tun_test.go global: bump copyright 2021-01-28 17:52:15 +01:00
uapi.go global: bump copyright 2021-01-28 17:52:15 +01:00
version.go version: bump snapshot 2020-11-18 14:24:17 +01:00