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

Issue 154360049: code review 154360049: encoding/gob: add custom decoder buffer for performance (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by r
Modified:
10 years, 4 months ago
Reviewers:
rsc
CC:
rsc, golang-codereviews
Visibility:
Public.

Description

encoding/gob: add custom decoder buffer for performance As we did with encoding, provide a trivial byte reader for faster decoding. We can also reduce some of the copying by doing the allocation all at once using a slightly different interface from byte buffers. benchmark old ns/op new ns/op delta BenchmarkEndToEndPipe 13368 12902 -3.49% BenchmarkEndToEndByteBuffer 5969 5642 -5.48% BenchmarkEndToEndSliceByteBuffer 479485 470798 -1.81% BenchmarkEncodeComplex128Slice 92367 92201 -0.18% BenchmarkEncodeFloat64Slice 39990 38960 -2.58% BenchmarkEncodeInt32Slice 30510 27938 -8.43% BenchmarkEncodeStringSlice 33753 33365 -1.15% BenchmarkDecodeComplex128Slice 232278 196704 -15.32% BenchmarkDecodeFloat64Slice 150258 128191 -14.69% BenchmarkDecodeInt32Slice 133806 115748 -13.50% BenchmarkDecodeStringSlice 335117 300534 -10.32%

Patch Set 1 #

Total comments: 1

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -40 lines) Patch
M src/encoding/gob/codec_test.go View 1 5 chunks +10 lines, -4 lines 0 comments Download
M src/encoding/gob/decode.go View 3 chunks +59 lines, -4 lines 0 comments Download
M src/encoding/gob/decoder.go View 3 chunks +10 lines, -32 lines 0 comments Download

Messages

Total messages: 3
r
Hello rsc (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
10 years, 5 months ago (2014-10-18 05:10:16 UTC) #1
rsc
LGTM https://codereview.appspot.com/154360049/diff/1/src/encoding/gob/codec_test.go File src/encoding/gob/codec_test.go (right): https://codereview.appspot.com/154360049/diff/1/src/encoding/gob/codec_test.go#newcode74 src/encoding/gob/codec_test.go:74: // decState := newDecodeState(bytes.NewBuffer(b.Bytes())) delete?
10 years, 4 months ago (2014-10-20 14:28:01 UTC) #2
r
10 years, 4 months ago (2014-10-20 14:33:13 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=8a62c0b8dfd4 ***

encoding/gob: add custom decoder buffer for performance
As we did with encoding, provide a trivial byte reader for
faster decoding. We can also reduce some of the copying
by doing the allocation all at once using a slightly different
interface from byte buffers.

benchmark                            old ns/op     new ns/op     delta
BenchmarkEndToEndPipe                13368         12902         -3.49%
BenchmarkEndToEndByteBuffer          5969          5642          -5.48%
BenchmarkEndToEndSliceByteBuffer     479485        470798        -1.81%
BenchmarkEncodeComplex128Slice       92367         92201         -0.18%
BenchmarkEncodeFloat64Slice          39990         38960         -2.58%
BenchmarkEncodeInt32Slice            30510         27938         -8.43%
BenchmarkEncodeStringSlice           33753         33365         -1.15%
BenchmarkDecodeComplex128Slice       232278        196704        -15.32%
BenchmarkDecodeFloat64Slice          150258        128191        -14.69%
BenchmarkDecodeInt32Slice            133806        115748        -13.50%
BenchmarkDecodeStringSlice           335117        300534        -10.32%

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/154360049
Sign in to reply to this message.

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