• Brad Fitzpatrick's avatar
    http2: reduce the number of select cases in serverConn.server · 34057069
    Brad Fitzpatrick authored
    This drops the number of select cases in serverConn.server from 10 to
    6. It was 7 in Go 1.7. It increased to 10 in Go 1.8.
    
    * replace testing-only testHookCh with always-on grab-bag serveMsgCh
      to be used for both test purposes, and infrequently used message
      types
    
    * remove the settingsTimer.C case for the initial settings timer
      and use serveMsgCh and time.AfterFunc instead
    
    * ... and do the same for the idle timeout timer.
    
    * ... and for the shutdown timer.
    
    * remove wantStartPushCh and just send the *startPushRequest to
      serveMsgCh too
    
    I could go further with this (and plan to, later), but these are the
    safe and easy ones that don't require more work elsewhere.
    
    The speed gets better the more the request/response go via the
    serverConn.serve loop. (once per Request.Body.Read or
    ResponseWriter.Flush):
    
      name            old time/op    new time/op  delta
      ServerGets-4    138µs ± 3%     134µs ± 2%   -2.54%   (p=0.002 n=10+10)
      ServerPosts-4   176µs ±27%     154µs ± 2%   -12.62%  (p=0.011 n=10+10)
    
    Updates kubernetes/kubernetes#45216
    Updates golang/go#20302
    
    Change-Id: I18019554089d7e3d76355d7137b5957e9597e803
    Reviewed-on: https://go-review.googlesource.com/43034
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
    34057069
Name
Last commit
Last update
bpf Loading commit data...
context Loading commit data...
dict Loading commit data...
dns/dnsmessage Loading commit data...
html Loading commit data...
http2 Loading commit data...
icmp Loading commit data...
idna Loading commit data...
internal Loading commit data...
ipv4 Loading commit data...
ipv6 Loading commit data...
lex/httplex Loading commit data...
lif Loading commit data...
nettest Loading commit data...
netutil Loading commit data...
proxy Loading commit data...
publicsuffix Loading commit data...
route Loading commit data...
trace Loading commit data...
webdav Loading commit data...
websocket Loading commit data...
xsrftoken Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
codereview.cfg Loading commit data...