Closed bradfitz closed 8 years ago
See issue #1642 (Set capacity of a slice) and https://golang.org/cl/8179043/ to help ReadRequest.
Patch attached to reduce some more. I'll send it out, broken up, after Go 1.1.
Attachments:
Patch to address one of the TODOs under the "Life of a Write" comment, bypassing the chunkWriter in some cases. Profiling didn't show any/much improvement, though. I didn't finish investigating why not. It should show a bit.
Attachments:
For after Go 1.1: https://golang.org/cl/8478044 (part of issue #5192, but a dependency here)
Work-in-progress playing during bus rides is at https://golang.org/cl/8543043 Currently at: BenchmarkServerHandlerNoHeader 1000000 10256 ns/op 791 B/op 8 allocs/op
This issue was updated by revision 0af302f50745b93e90a4507993a555d246acef4.
R=r CC=gobot, golang-dev https://golang.org/cl/8478044
This issue was updated by revision d4cbc80d106a3f3b53631aa60b400c790b14bb5.
R=nigeltao CC=golang-dev https://golang.org/cl/9432046
This issue was updated by revision 27f7427995782bf60195ca65fd9b44aa34913b7.
R=golang-dev, daniel.morsing CC=golang-dev https://golang.org/cl/9492044
These are mostly all in now. All that remains is: https://golang.org/cl/9584043 but the extra channel operations end up not being worth the reduced GC time. If a sync.Cache goes in (issue #4720), then 9584043 might be worth it.
This issue was updated by revision 509a1173a33d4fd914409cd941470d440fd5eed.
R=r CC=gobot, golang-dev https://golang.org/cl/8478044 »»» R=r CC=golang-dev https://golang.org/cl/9462049
@bradfitz I was just looking through this issue and decided to re-run your initial test, there was one crash
$ git log | head -n 1 && go version
commit c2ef005486fa05cbeddc74c7faac8f6a867703d4
go version devel +c2ef005 Thu Dec 10 04:43:08 2015 +0000 darwin/amd64
$ ./http.test -test.v -test.run=none -test.bench=ServerHandler -test.cpuprofile=prof.cpu -test.benchtime=4s
PASS
BenchmarkServerHandlerTypeLen-4 1000000 5549 ns/op 1858 B/op 17 allocs/op
BenchmarkServerHandlerNoLen-4 1000000 5385 ns/op 1826 B/op 14 allocs/op
BenchmarkServerHandlerNoType-4 1000000 5148 ns/op 1826 B/op 15 allocs/op
BenchmarkServerHandlerNoHeader-4 2000000 4358 ns/op 1041 B/op 9 allocs/op
$
$ # Second run because ./http.test -test.v -test.run=none -test.bench=ServerHandler -test.cpuprofile=prof.cpu -test.benchtime=4s only runs clause with `-test.v -test.run=none -test.bench=ServerHandler`
$ ./http.test -test.cpuprofile=prof.cpu -test.benchtime=4s
--- FAIL: TestTransportConcurrency (0.11s)
transport_test.go:1216: error on req request-465: Get http://127.0.0.1:55568/?echo=request-465: write tcp 127.0.0.1:55825->127.0.0.1:55568: write: socket is not connected
FAIL
Otherwise this looks like an improvement
BenchmarkServerHandlerTypeLen 1000000 11098 ns/op 1878 B/op 19 allocs/op
BenchmarkServerHandlerNoLen 1000000 10249 ns/op 1843 B/op 17 allocs/op
BenchmarkServerHandlerNoType 1000000 10620 ns/op 1844 B/op 17 allocs/op
BenchmarkServerHandlerNoHeader 1000000 8674 ns/op 1051 B/op 12 allocs/op
BenchmarkServerHandlerTypeLen-4 1000000 5549 ns/op 1858 B/op 17 allocs/op
BenchmarkServerHandlerNoLen-4 1000000 5385 ns/op 1826 B/op 14 allocs/op
BenchmarkServerHandlerNoType-4 1000000 5148 ns/op 1826 B/op 15 allocs/op
BenchmarkServerHandlerNoHeader-4 2000000 4358 ns/op 1041 B/op 9 allocs/op
@odeke-em, this bug is really old. I think it's probably just time to close it. We can open new specific bugs as needed.
Roger that, thanks!
Attachments: