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

Issue 6561069: code review 6561069: textproto: string interning on headers to reduce allocations (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by jeff.allen
Modified:
11 years, 6 months ago
Reviewers:
gburd, dave, bradfitz
CC:
golang-dev
Visibility:
Public.

Description

textproto: string interning on headers to reduce allocations Saving one allocation per header for common HTTP headers results in more transactions/GC in a webserver and a lower "GC tax" per transaction, and a higher throughput. benchmark old ns/op new ns/op delta BenchmarkReadMIMEHeader 12811 13240 +3.35% benchmark old allocs new allocs pct new/old BenchmarkReadMIMEHeader 32.00 24.00 75.00 Timings are noisy; worst case in 5 trials above; the average is 0% time delta. Also, updated benchcmp to show alloc savings.

Patch Set 1 #

Patch Set 2 : diff -r 8e69b6243f49 https://code.google.com/p/go #

Patch Set 3 : diff -r 8e69b6243f49 https://code.google.com/p/go #

Patch Set 4 : diff -r 8e69b6243f49 https://code.google.com/p/go #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -3 lines) Patch
M misc/benchcmp View 1 2 chunks +19 lines, -0 lines 0 comments Download
M src/pkg/net/textproto/reader.go View 1 2 2 chunks +117 lines, -0 lines 1 comment Download
M src/pkg/net/textproto/reader_test.go View 1 2 1 chunk +35 lines, -3 lines 0 comments Download

Messages

Total messages: 6
jeff.allen
Hello bradfitz@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 7 months ago (2012-09-28 10:25:21 UTC) #1
dave_cheney.net
On 2012/09/28 10:25:21, jeff.allen wrote: > Hello mailto:bradfitz@golang.org (cc: mailto:golang-dev@googlegroups.com), > > I'd like you ...
11 years, 7 months ago (2012-09-28 12:16:17 UTC) #2
gburd
http://codereview.appspot.com/6561069/diff/5001/src/pkg/net/textproto/reader.go File src/pkg/net/textproto/reader.go (right): http://codereview.appspot.com/6561069/diff/5001/src/pkg/net/textproto/reader.go#newcode644 src/pkg/net/textproto/reader.go:644: headerPool[hk] = h The strings in commonHeaders are in ...
11 years, 7 months ago (2012-09-28 15:37:57 UTC) #3
jeff.allen
*** Abandoned ***
11 years, 6 months ago (2012-10-03 12:22:24 UTC) #4
bradfitz
Did you mean to abandon this? I was out Friday and Monday or I would've ...
11 years, 6 months ago (2012-10-03 13:18:40 UTC) #5
jeff.allen
11 years, 6 months ago (2012-10-03 13:55:26 UTC) #6
Was not totally on purpose (I clearly don't know the difference between -d and
-D), but I am working on a better measurement of the impact, and will send it in
again when that's done. Sorry for the noise.
Sign in to reply to this message.

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