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

Issue 5236043: code review 5236043: gob: avoid one allocation for every message written. (Closed)

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

Description

gob: avoid one copy for every message written. Plus the need for a second in-memory buffer. Plays a bit fast and loose with the contents of a byte buffer, but saves a potentially huge allocation. The gotest run is about 10% faster overall after this change.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -14 lines) Patch
M src/pkg/gob/encode.go View 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/gob/encoder.go View 1 2 3 chunks +22 lines, -14 lines 0 comments Download

Messages

Total messages: 7
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 5 months ago (2011-10-07 21:37:37 UTC) #1
r2
hold on
13 years, 5 months ago (2011-10-07 21:41:16 UTC) #2
r
Hello golang-dev@googlegroups.com, r@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 5 months ago (2011-10-07 21:45:10 UTC) #3
gri
LGTM My only question is why it's not possible to reserve the space before (and ...
13 years, 5 months ago (2011-10-08 04:05:11 UTC) #4
r
I don't understand. How can you reserve space before the write when that is after ...
13 years, 5 months ago (2011-10-08 05:14:22 UTC) #5
gri
per verbal discussion, LGTM. - gri On Fri, Oct 7, 2011 at 10:14 PM, <r@golang.org> ...
13 years, 5 months ago (2011-10-10 18:45:22 UTC) #6
r
13 years, 5 months ago (2011-10-10 19:38:54 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=b4311778f494 ***

gob: avoid one copy for every message written.
Plus the need for a second in-memory buffer.
Plays a bit fast and loose with the contents of a byte buffer,
but saves a potentially huge allocation. The gotest
run is about 10% faster overall after this change.

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

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