]> Cypherpunks repositories - gostls13.git/commit
runtime: don't recreate netpoll timers if they don't change
authorDmitry Vyukov <dvyukov@google.com>
Wed, 31 Oct 2018 15:18:36 +0000 (16:18 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 2 Nov 2018 12:48:25 +0000 (12:48 +0000)
commit86d375498fa377c7d81c5b93750e8dce2389500e
tree0a9a2ebf78f85d3cfe48ecf5deb09c7c6244eea8
parenta9280fa2de5b9dc13f75dd3aebdf4a218fca451e
runtime: don't recreate netpoll timers if they don't change

Currently we always delete both read and write timers and then
add them again. However, if user setups read and write deadline
separately, then we don't need to touch the other one.

name                  old time/op  new time/op  delta
TCP4OneShotTimeout-6  17.2µs ± 0%  17.2µs ± 0%     ~     (p=0.310 n=5+5)
SetReadDeadline-6      319ns ± 1%   274ns ± 2%  -13.94%  (p=0.008 n=5+5)

Update #25729

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