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

Issue 7799047: code review 7799047: net/http: reuse bufio.Reader and bufio.Writer between conns (Closed)

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

Description

net/http: reuse bufio.Reader and bufio.Writer between conns Saves over 8KB of allocations per new connection. benchmark old ns/op new ns/op delta BenchmarkServerFakeConnNoKeepAlive 28777 24927 -13.38% benchmark old allocs new allocs delta BenchmarkServerFakeConnNoKeepAlive 52 46 -11.54% benchmark old bytes new bytes delta BenchmarkServerFakeConnNoKeepAlive 13716 5286 -61.46%

Patch Set 1 #

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

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

Total comments: 2

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

Total comments: 1

Patch Set 5 : diff -r 86d952ac0976 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r b22e986f983e https://go.googlecode.com/hg/ #

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

Messages

Total messages: 8
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 2 months ago (2013-03-20 04:54:06 UTC) #1
adg
LGTM https://codereview.appspot.com/7799047/diff/4001/src/pkg/net/http/server.go File src/pkg/net/http/server.go (right): https://codereview.appspot.com/7799047/diff/4001/src/pkg/net/http/server.go#newcode807 src/pkg/net/http/server.go:807: c.bufswr.Reader = nil put this in a putBufioReader ...
11 years, 2 months ago (2013-03-21 18:57:01 UTC) #2
bradfitz
Hello golang-dev@googlegroups.com, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-03-21 21:54:44 UTC) #3
adg
https://codereview.appspot.com/7799047/diff/10001/src/pkg/net/http/server.go File src/pkg/net/http/server.go (right): https://codereview.appspot.com/7799047/diff/10001/src/pkg/net/http/server.go#newcode446 src/pkg/net/http/server.go:446: sw.Writer = nil i think you should set this ...
11 years, 2 months ago (2013-03-21 22:06:08 UTC) #4
adg
LGTM Oh wait, no, of course this makes sense.
11 years, 2 months ago (2013-03-21 22:32:18 UTC) #5
bradfitz
Hello golang-dev@googlegroups.com, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-03-22 01:34:48 UTC) #6
adg
LGTM
11 years, 2 months ago (2013-03-22 01:38:01 UTC) #7
bradfitz
11 years, 2 months ago (2013-03-22 03:02:04 UTC) #8
*** Submitted as https://code.google.com/p/go/source/detail?r=622b70313576 ***

net/http: reuse bufio.Reader and bufio.Writer between conns

Saves over 8KB of allocations per new connection.

benchmark                             old ns/op    new ns/op    delta
BenchmarkServerFakeConnNoKeepAlive        28777        24927  -13.38%

benchmark                            old allocs   new allocs    delta
BenchmarkServerFakeConnNoKeepAlive           52           46  -11.54%

benchmark                             old bytes    new bytes    delta
BenchmarkServerFakeConnNoKeepAlive        13716         5286  -61.46%

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

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