Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Issue 8094046: code review 8094046: net/http: reuse textproto.Readers; remove 2 more allocations (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by bradfitz
Modified:
11 years, 11 months ago
Reviewers:
CC:
golang-dev, r, gri
Visibility:
Public.

Description

net/http: reuse textproto.Readers; remove 2 more allocations Saves both the textproto.Reader allocation, and its internal scratch buffer growing. benchmark old ns/op new ns/op delta BenchmarkServerFakeConnWithKeepAliveLite 10324 10149 -1.70% benchmark old allocs new allocs delta BenchmarkServerFakeConnWithKeepAliveLite 19 17 -10.53% benchmark old bytes new bytes delta BenchmarkServerFakeConnWithKeepAliveLite 1559 1492 -4.30%

Patch Set 1 #

Patch Set 2 : diff -r a933e165d2ff https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r a933e165d2ff https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 4 : diff -r f9cb5530d0d8 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -1 line) Patch
M src/pkg/net/http/request.go View 1 2 3 2 chunks +23 lines, -1 line 0 comments Download

Messages

Total messages: 5
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 11 months ago (2013-03-28 21:42:06 UTC) #1
r
LGTM https://codereview.appspot.com/8094046/diff/5001/src/pkg/net/http/request.go File src/pkg/net/http/request.go (right): https://codereview.appspot.com/8094046/diff/5001/src/pkg/net/http/request.go#newcode482 src/pkg/net/http/request.go:482: var textprotoReaderCache = make(chan *textproto.Reader, 4) how did ...
11 years, 11 months ago (2013-03-28 21:43:28 UTC) #2
gri
LGTM https://codereview.appspot.com/8094046/diff/5001/src/pkg/net/http/request.go File src/pkg/net/http/request.go (right): https://codereview.appspot.com/8094046/diff/5001/src/pkg/net/http/request.go#newcode481 src/pkg/net/http/request.go:481: // TODO: use a sync.Cache when available // ...
11 years, 11 months ago (2013-03-28 21:46:08 UTC) #3
bradfitz
https://codereview.appspot.com/8094046/diff/5001/src/pkg/net/http/request.go File src/pkg/net/http/request.go (right): https://codereview.appspot.com/8094046/diff/5001/src/pkg/net/http/request.go#newcode482 src/pkg/net/http/request.go:482: var textprotoReaderCache = make(chan *textproto.Reader, 4) On 2013/03/28 21:43:29, ...
11 years, 11 months ago (2013-03-28 21:47:16 UTC) #4
bradfitz
11 years, 11 months ago (2013-03-28 21:51:23 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=402e871d840e ***

net/http: reuse textproto.Readers; remove 2 more allocations

Saves both the textproto.Reader allocation, and its internal
scratch buffer growing.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10324        10149   -1.70%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           19           17  -10.53%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1559         1492   -4.30%

R=golang-dev, r, gri
CC=golang-dev
https://codereview.appspot.com/8094046
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b