]> Cypherpunks repositories - gostls13.git/commit
runtime: add and use modtimer in netpoll
authorDmitry Vyukov <dvyukov@google.com>
Wed, 31 Oct 2018 16:03:35 +0000 (17:03 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 2 Nov 2018 12:49:16 +0000 (12:49 +0000)
commita86f549703c107c8b4d83d8e7527521c9e215d9a
tree07dc006883bd7b4cf9d2b0581e11109ee28b6403
parent86d375498fa377c7d81c5b93750e8dce2389500e
runtime: add and use modtimer in netpoll

Currently when netpoll deadline is incrementally prolonged,
we delete and re-add timer each time.
Add modtimer function that does both and use it when we need
to modify an existing netpoll timer to avoid unnecessary lock/unlock.

TCP4OneShotTimeout-6  17.2µs ± 0%  17.0µs ± 0%  -0.82%  (p=0.008 n=5+5)
SetReadDeadline-6      274ns ± 2%   261ns ± 0%  -4.89%  (p=0.008 n=5+5)

Update #25729

Change-Id: I08b89dbbc1785dd180e967a37b0aa23b0c4613a8
Reviewed-on: https://go-review.googlesource.com/c/146339
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/netpoll.go
src/runtime/time.go