- 24 May, 2017 4 commits
-
-
Mikio Hara authored
This change uses the internal/socket package to ensure that the ipv4 package works with all supported versions of the Go standard library. Fixes golang/go#19051. Change-Id: If0256007c749c319970533823a10afdc1ffbce31 Reviewed-on: https://go-review.googlesource.com/37036Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
This is a counterpart of https://go-review.googlesource.com/37039. This change introduces a package that provides a portable interface for the manipulation of sockets using either syscall.Conn and syscall.RawConn interfaces or the internal/netreflect package appropriately. The package ensures that a package using this works with all supported versions of the Go standard library. Updates golang/go#19051. Change-Id: Ib72ea369e6839e77fed6e35b9aedc364e73c51cb Reviewed-on: https://go-review.googlesource.com/37035Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Fix by Martin Garton in https://golang.org/cl/43370 Change-Id: I5933b136ff667c0f67ec8ebffb52d6f1235232b3 Reviewed-on: https://go-review.googlesource.com/44030Reviewed-by: Matt Layher <mdlayher@gmail.com>
-
Tom Bergan authored
This is a better fix that https://golang.org/cl/43455. Instead of creating a separate goroutine to wait for the global shutdown channel, we reuse the new serverMsgCh, which was added in a prior CL. We also use the new net/http.Server.RegisterOnShutdown method to register a shutdown callback for each http2.Server. Updates golang/go#20302 Updates golang/go#18471 Change-Id: Icf29d5e4f65b3779d1fb4ea92924e4fb6bdadb2a Reviewed-on: https://go-review.googlesource.com/43230 Run-TryBot: Tom Bergan <tombergan@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 23 May, 2017 1 commit
-
-
Tom Bergan authored
After a response body is closed, we keep writing to the bufPipe. This accumulates bytes that will never be read, wasting memory. The fix is to discard the buffer on pipe.BreakWithError. Updates golang/go#20448 Change-Id: Ia2cf46cb8c401fd8091ef3785eb48fe7b188bb57 Reviewed-on: https://go-review.googlesource.com/43810 Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 22 May, 2017 3 commits
-
-
Brad Fitzpatrick authored
Updates golang/go#20448 Change-Id: I6366b0b0b36d81095ab347ca35e1e72169c05c15 Reviewed-on: https://go-review.googlesource.com/43853 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com>
-
Dmitri Shuralyov authored
Move it to a _test.go file instead. After CL 43190, the pair function is no longer used by the hpack package, so it can be removed from it. It's still used by tests. This can help avoid future readers spending time on figuring out why pair exists in package, but is not used. It can also reduce chance of the pair function unintentionally being used in the package (if that needs to happen explicitly, then pair can be easily moved back to package). Change-Id: I12ee9b46f57a522bd09e5d0ee22296df4dee1f35 Reviewed-on: https://go-review.googlesource.com/43851Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Todd Neal authored
Inlining isn't performed on generated init functions. Removing the pair function and initializing the structs directly saves another 16k on a simple http.ListenAndServe() binary. delta name old new -58 runtime.findfunctab 10471 10413 -0.55% -41 runtime.gcbss 910 869 -4.51% 41 runtime.gcdata 612 653 6.70% -408 runtime.pclntab 1036311 1035903 -0.04% -11711 vendor/golang_org/x/net/http2/hpack.init 12283 572 -95.34% Updates golang/go#6853 Change-Id: Ibccc796fe7403674cf4b4561acf9551d76ff11e8 Reviewed-on: https://go-review.googlesource.com/43190 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 17 May, 2017 1 commit
-
-
Mikio Hara authored
Change-Id: I5ee078009033eea6d4b9320de127a270bd3c439c Reviewed-on: https://go-review.googlesource.com/43471Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 15 May, 2017 1 commit
-
-
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: Tom Bergan <tombergan@google.com>
-
- 13 May, 2017 1 commit
-
-
Tom Bergan authored
gracefulShutdownCh is shared by all connections in a server. When a server accumulates many connections (e.g., 5000 in the kubemark-5000 benchmark), we have 5000 serverConn.serve goroutines selecting on this channel. This means 5000 goroutines hammer the channel's lock, which causes severe lock contention. The fix in this CL is to make a local proxy for gracefulShutdownCh in each connection so that each connection selects on gracefulShutdownCh at most once per connection rather than once per serverConn.serve loop iteration. This fix is intended to be backported quickly into Go 1.8.2. The downside of this fix is 2KB extra stack usage per connection. A better fix will be implemented in Go 1.9. Unfortunately, I have been unable to reproduce this problem locally. This fix was verified by the kubernetes team. See: https://github.com/kubernetes/kubernetes/issues/45216#issuecomment-300830243 Updates golang/go#20302 Change-Id: I19ab19268a6ccab9b6e9dffa0cfbc89b8c7d0f19 Reviewed-on: https://go-review.googlesource.com/43455 Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 10 May, 2017 1 commit
-
-
Todd Neal authored
This shrinks a binary that just does an http.ListenAndServe by about 90kb due to using less code for the static array. syms delta name old-size new-size pct-difference -54206 vendor/golang_org/x/net/http2/hpack.newStaticTable 55233 1027 -98.14% -4744 runtime.pclntab 1041055 1036311 -0.46% -204 runtime.findfunctab 10675 10471 -1.91% 8 runtime.typelink 9852 9860 0.08% 41 runtime.gcbss 869 910 4.72% 11711 vendor/golang_org/x/net/http2/hpack.init 572 12283 2047.38% sections delta name old-size new-size pct-difference -41888 .text 2185840 2143952 -1.92% -37644 .rodata 842131 804487 -4.47% -4744 .gopclntab 1041055 1036311 -0.46% -3343 .debug_info 981995 978652 -0.34% -2931 .debug_line 291295 288364 -1.01% 8 .typelink 9852 9860 0.08% 59 .debug_pubnames 81986 82045 0.07% 96 .symtab 186312 186408 0.05% 113 .debug_pubtypes 137500 137613 0.08% 128 .debug_frame 219140 219268 0.06% 220 .strtab 217109 217329 0.10% 2464 .bss 127752 130216 1.93% Updates golang/go#6853 Change-Id: I3383e63300585539507b75faac1072264d8f37e7 Reviewed-on: https://go-review.googlesource.com/43090Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 09 May, 2017 1 commit
-
-
Mikio Hara authored
This is a followup to https://go-review.googlesource.com/30576. Change-Id: I48bc5f1781275d2cef963876745fa59ac08b5eb5 Reviewed-on: https://go-review.googlesource.com/43070 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 03 May, 2017 1 commit
-
-
Dmitry Savintsev authored
Make all the ciphers from https://www.iana.org/assignments/tls-parameters/tls-parameters.txt available as package constants (no longer relying on crypto/tls). Number of bad ciphers such as TLS_RSA_WITH_AES_128_CBC_SHA256 from https://tools.ietf.org/html/rfc7540#appendix-A are added to the HTTP/2 blacklist (also listed in https://http2.github.io/http2-spec/#BadCipherSuites). The zero CipherSuite TLS_NULL_WITH_NULL_NULL (0x00) is now explicitly marked as a bad one which required change of some test mocks. Fixes golang/go#20213 Change-Id: I6b02061603cce4cf469998606400ed6729199238 Reviewed-on: https://go-review.googlesource.com/42510 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 02 May, 2017 1 commit
-
-
Martin Probst authored
Passing a zero length key (or secret) gives no safety against XSRF attacks. This is a relatively easy mistake to make, e.g. by passing `make([]byte, 0, 1024)` to `rand.Read` instead of `make([]byte, 1024)`, and currently fails open, silently. This uses panic, as the API does not allow returning a structured error, and catching this programming error is not worth breaking API compatibility. Passing a zero length secret is also not an error condition that API callers would handle, so there is little value in returning a proper error. Change-Id: Ib6457347675872188d51d2a220eee4b67900f79e Reviewed-on: https://go-review.googlesource.com/42411Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 24 Apr, 2017 2 commits
-
-
Mikio Hara authored
This is not perfect but is enough for during the dual IP stack era. Fixes golang/go#19298. Change-Id: I5f16b10fda5ddfe470edb021d9a6d7e2a642d267 Reviewed-on: https://go-review.googlesource.com/41515 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Mikio Hara authored
This is not perfect but is enough for during the dual IP stack era. Change-Id: Icd318f75b3ed8c73ccd588be8122379b263651fb Reviewed-on: https://go-review.googlesource.com/41514 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 23 Apr, 2017 1 commit
-
-
Brad Fitzpatrick authored
App Engine is stuck 14 months in the past and doesn't have context. Updates golang/go#20056 Change-Id: I2cb2a3a75af07728805be8c714e4725f01a17074 Reviewed-on: https://go-review.googlesource.com/41413 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 21 Apr, 2017 2 commits
-
-
Eyal Posener authored
in the resyncConn, break the read loop on read error. if error is returned, constantly, and the loop is not breaking, the test will never finish. continue to fail the test on this unexpected error is also pointless. Change-Id: I8f2f5e7b3d37c2a194cbdcde51734580f5b2436d Reviewed-on: https://go-review.googlesource.com/41332Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fixes golang/go#20056 Change-Id: I139d531ae87273fdc2409d29d63bb9d67680f30a Reviewed-on: https://go-review.googlesource.com/41290 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 13 Apr, 2017 1 commit
-
-
Tom Bergan authored
This is required by RFC 7540 Section 8.1. Bug pointed out by Mike Bishop. Updates golang/go#19948 Change-Id: I58d4f499609fd493d33115f4e1f64caf4bcbbc03 Reviewed-on: https://go-review.googlesource.com/40630Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 06 Apr, 2017 1 commit
-
-
Kale Blankenship authored
If the writeDeadline elapses RST_STREAM is sent with ErrCodeInternal. Fixes tests added in https://golang.org/cl/34726 Updates golang/go#18437 (fixes once it's bundled into net/http) Change-Id: I84e4f76753963c29cd3c06730d6bfbb7f1ee6051 Reviewed-on: https://go-review.googlesource.com/34727Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 29 Mar, 2017 2 commits
-
-
Jaana Burcu Dogan authored
Change-Id: Ib30bbe789718bf1e6d455c0011f27c3db6f7cba5 Reviewed-on: https://go-review.googlesource.com/38783Reviewed-by: Tom Bergan <tombergan@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Chris Roche authored
An earlier performance change, https://golang.org/cl/37406, made headerFieldTable lookups O(1). The entries in the maps used to perform these lookups were not evicted along with the original field elements, however causing a gradual memory leak. This is most apparent when the headers have highly variable content such as request IDs or timings. Fixes golang/go#19756 Change-Id: Icdb51527eb671925216350ada15f2a1336ea3158 Reviewed-on: https://go-review.googlesource.com/38781Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 28 Mar, 2017 2 commits
-
-
Jaana Burcu Dogan authored
Change-Id: Ic749ab27f45472b9a21dee9a16567d2f7741d9b1 Reviewed-on: https://go-review.googlesource.com/38780Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Jaana Burcu Dogan authored
In this demo, it takes almost twice as much to load all items on a page without HTTP/2 Server Push. Change-Id: Ie5c9814c4dcf9ff9f21ed215d4eb58d108715f50 Reviewed-on: https://go-review.googlesource.com/38657 Run-TryBot: Jaana Burcu Dogan <jbd@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com>
-
- 24 Mar, 2017 2 commits
-
-
Jaana Burcu Dogan authored
Server Push is not more performant than regular HTTP/2 test for this demo. I will produce a new demo page where Server Push is clearly a better choice and consistently faster. This reverts commit 3e967e1d. Change-Id: Iace26e17714c0eca52785fc04d410df041e56415 Reviewed-on: https://go-review.googlesource.com/38608Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Marcel van Lohuizen authored
The version is not only API compatible, but is also meant to mimic the original behavior of doing Punycode only with only a minimum of additional checks. Integrated from x/text/internal/export/idna at Git SHA1 fc7fa097411d30e6708badff276c4c164425590c. All checks making things fundamentally stricter or checks that require tables are now optional. Fixes golang/go#18567 Fixes golang/go#18582 Change-Id: I08e6d7f7c276d1d84e02391e22f60c0a44a8ddad Reviewed-on: https://go-review.googlesource.com/37050 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 23 Mar, 2017 1 commit
-
-
Jaana Burcu Dogan authored
Server Push of tiles are not always the fastest. But, it might be good to have the sample available to demonstrate how Push is handled by the browser. Change-Id: I967db9693e0889a889a36ad82248acef2c6db8d4 Reviewed-on: https://go-review.googlesource.com/38349Reviewed-by: Tom Bergan <tombergan@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 08 Mar, 2017 2 commits
-
-
Brad Fitzpatrick authored
Updates golang/go#19264 Change-Id: Ib5b483d2d830d7a51d59eb7bc5eac106da5d5476 Reviewed-on: https://go-review.googlesource.com/37944 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com>
-
Mikio Hara authored
Change-Id: Ib5e3eac7c98d07c286dfb49fced89ac90bd0aafc Reviewed-on: https://go-review.googlesource.com/37916 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 03 Mar, 2017 1 commit
-
-
Ian Gudger authored
The Go standard library contains support for packing and unpacking of DNS messages, but it is not exported, doesn't follow Go style, and is not very well optimized. Low level DNS functionality is clearly useful to the Go community as evidenced by the success of github.com/miekg/dns. This implementation endeavors to avoid the limitations of both the standard library and github.com/miekg/dns implementations and is an almost complete rewrite of the code currently found in on net/dnsmsg.go and net/dnsmsg_test.go. Goals: * Minimize heap allocations. * Allow parsing only what is needed. Avoid unnecessary parsing and heap allocations for parts of the message that you don't care about. Parsing should be allowed on as small of a granularity as is useful, but no smaller as to avoid complicating the interface. * Parse and pack each byte of the message at most one time. Updates golang/go#16218 Updates golang/go#10622 Change-Id: Ib754d0007609a617d88be867f21c2feb15b6fcd7 Reviewed-on: https://go-review.googlesource.com/35237 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
-
- 27 Feb, 2017 3 commits
-
-
Tom Bergan authored
Upload performance is poor when BDP is higher than the flow-control window. Previously, the server's receive window was fixed at 64KB, which resulted in very poor performance for high-BDP links. The receive window now defaults to 1MB and is configurable. The per-connection and per-stream windows are configurable separately (both default to 1MB as suggested in golang/go#16512). Previously, the server created a "fixedBuffer" for each request body. This is no longer a good idea because a fixedBuffer has fixed size, which means individual streams cannot use varying amounts of the available connection window. To overcome this limitation, I replaced fixedBuffer with "dataBuffer", which grows and shrinks based on current usage. The worst-case fragmentation of dataBuffer is 32KB wasted memory per stream, but I expect that worst-case will be rare. A slightly modified version of adg@'s grpcbench program shows a dramatic improvement when increasing from a 64KB window to a 1MB window, especially at higher latencies (i.e., higher BDPs). Network latency was simulated with netem, e.g., `tc qdisc add dev lo root netem delay 16ms`. Duration Latency Proto H2 Window 11ms±4.05ms 0s HTTP/1.1 - 17ms±1.95ms 0s HTTP/2.0 65535 8ms±1.75ms 0s HTTP/2.0 1048576 10ms±1.49ms 1ms HTTP/1.1 - 47ms±2.91ms 1ms HTTP/2.0 65535 10ms±1.77ms 1ms HTTP/2.0 1048576 15ms±1.69ms 2ms HTTP/1.1 - 88ms±11.29ms 2ms HTTP/2.0 65535 15ms±1.18ms 2ms HTTP/2.0 1048576 23ms±1.42ms 4ms HTTP/1.1 - 152ms±0.77ms 4ms HTTP/2.0 65535 23ms±0.94ms 4ms HTTP/2.0 1048576 40ms±1.54ms 8ms HTTP/1.1 - 288ms±1.67ms 8ms HTTP/2.0 65535 39ms±1.29ms 8ms HTTP/2.0 1048576 72ms±1.13ms 16ms HTTP/1.1 - 559ms±0.68ms 16ms HTTP/2.0 65535 71ms±1.12ms 16ms HTTP/2.0 1048576 136ms±1.15ms 32ms HTTP/1.1 - 1104ms±1.62ms 32ms HTTP/2.0 65535 135ms±0.96ms 32ms HTTP/2.0 1048576 264ms±0.95ms 64ms HTTP/1.1 - 2191ms±2.08ms 64ms HTTP/2.0 65535 263ms±1.57ms 64ms HTTP/2.0 1048576 Fixes golang/go#16512 Updates golang/go#17985 Updates golang/go#18404 Change-Id: Ied385aa94588337e98dad9475cf2ece2f39ba346 Reviewed-on: https://go-review.googlesource.com/37226Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Tom Bergan authored
The previous algorithm was linear in the size of the table. The new algorithm is O(1). The new algorithm should behave exactly like the old algorthm, except for one unimportant change that triggered small updates to tests in encode_test.go: When encoding "Field: Value" where the table has two entries, [0]={"Field", "X"} and [1]={"Field", "Y"}, we can encode the field name using either table entry. Previously, we selected the oldest entry, but now we select the newest entry. The new implementation should actually generate very slightly better compression because new entries are encoded with smaller integers than old entries, and HPACK uses a varint encoding for integers where smaller integers are encoded in fewer bytes. I added a synthetic microbenchmark which shows a big speedup in hpack.Encoder.searchTable: BenchmarkEncoderSearchTable-40 100000 127440 ns/op # before BenchmarkEncoderSearchTable-40 50000 25121 ns/op # after Change-Id: Ib87d61b6415d9f0ff38874fe2a719b2f00351590 Reviewed-on: https://go-review.googlesource.com/37406Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alexander Polcyn authored
The existing Framer in net/http2 allocates a new DataFrame struct for each DataFrame read on calls to ReadFrame. The SetReuseFrame option introduced here, if set on a Framer, allows the Framer to reuse Frame objects and changes the ReadFrame API so that returned Frame objects are only valid until the next call to ReadFrame. This opt-in API now only implements reuse of DataFrames, but it allows the Framer to reuse of any type of Frame. The footprint caused by creation of new DataFrame structs per data frame was noticed in micro benchmarks of "gRPC" server "streaming throuhgput", which uses the Framer in this package. This benchmark happened to use long lived http2 streams that do client-server "ping-pong" requests with small data frames, and DataFrames were seen to be a significant source of allocations. Running local benchmarks with: (from x/net/http2 directory) $ go test -run=^$ -bench=BenchmarkServerToClientStream example output: * expect an alloc reduction of at least 1 and a small memory reduction between "BenchmarkServerToClientStreamDefaultOptions" and "BenchmarkServerToClientStreamReuseFrames" BenchmarkServerToClientStreamDefaultOptions-12 30000 46216 ns/op 971 B/op 17 allocs/op BenchmarkServerToClientStreamReuseFrames-12 30000 44952 ns/op 924 B/op 16 allocs/op Fixes golang/go#18502 Change-Id: Iad93420ef6c3918f54249d867098f1dadfa324d8 Reviewed-on: https://go-review.googlesource.com/34812 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 24 Feb, 2017 1 commit
-
-
Tom Bergan authored
fixedBuffer was a bad idea for two reasons: 1. It was fixed at a constant 64KB (the current default flow-control window) which wastes memory on the server when clients upload many small request bodies. 2. A follow-up CL will allow configuring the server's connection and stream receive windows. We want to allow individual streams to use varying amounts of the available connection window. This is not possible when each stream uses a fixedBuffer. dataBuffer grows and shrinks based on current usage. The worst-case fragmentation of dataBuffer is 32KB wasted memory per stream, but I expect that worst-case will be rare. In particular, if the declared size of a stream's request body is under 1KB, then the server will not allocate more than 1KB to process that stream's request body. Updates golang/go#16512 Fixes golang/go#18509 Change-Id: Ibcb18007037e82518a65848ef3baf4937955ac9d Reviewed-on: https://go-review.googlesource.com/37400 Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 23 Feb, 2017 2 commits
-
-
Brad Fitzpatrick authored
Delete the constant time string comparison. It's slow and shows up in profiles, nobody else does it, and the spec text no longer recommends doing it. See bug for discussion and details. Also clean up some naked returns while I'm here (noted during review). Fixes golang/go#19238 Change-Id: I344c5766c5d97bbcf01eab0624097941591ce00f Reviewed-on: https://go-review.googlesource.com/37394 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com>
-
Brad Fitzpatrick authored
The x/net package is currently broken for Go 1.9 (#19051) so I am unable to use trybots for x/net/http2. This disables the tests for the broken stuff and makes things compile at least, so x/net trybots aren't broken for others. Updates golang/go#19051 Change-Id: I67401d7ad32d855e99a417545328eb4e803287cc Reviewed-on: https://go-review.googlesource.com/37401 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com> Reviewed-by: Martin Möhrmann <moehrmann@google.com>
-
- 18 Feb, 2017 2 commits
-
-
Mikio Hara authored
This change drops a workaround for golang.org/issues/13372. The compiler in Go 1.6 or above handles the "conversion of a unsafe.Pointer to uintptr when calling syscall.Syscall" case correctly. Also fixes a typo. Change-Id: I0433f3b8f75b34437aad91c6e8cf103e884d2a83 Reviewed-on: https://go-review.googlesource.com/37171Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
This change drops a workaround for golang.org/issues/13372. The compiler in Go 1.6 or above handles the "conversion of a unsafe.Pointer to uintptr when calling syscall.Syscall" case correctly. Change-Id: I5b45094a78f15a631da277bbea0cb79fde25bb2a Reviewed-on: https://go-review.googlesource.com/37170Reviewed-by: Ian Lance Taylor <iant@golang.org>
-