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

Issue 147720043: code review 147720043: encoding/gob: speedup encoding (Closed)

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

Description

encoding/gob: speedup encoding Replace typeLock with copy-on-write map using atomic.Value. benchmark old ns/op new ns/op delta BenchmarkEndToEndPipe 7722 7709 -0.17% BenchmarkEndToEndPipe-2 5114 4344 -15.06% BenchmarkEndToEndPipe-4 3192 2429 -23.90% BenchmarkEndToEndPipe-8 1833 1438 -21.55% BenchmarkEndToEndPipe-16 1332 983 -26.20% BenchmarkEndToEndPipe-32 1444 675 -53.25% BenchmarkEndToEndByteBuffer 6474 6019 -7.03% BenchmarkEndToEndByteBuffer-2 4280 2810 -34.35% BenchmarkEndToEndByteBuffer-4 2264 1774 -21.64% BenchmarkEndToEndByteBuffer-8 1275 979 -23.22% BenchmarkEndToEndByteBuffer-16 1257 753 -40.10% BenchmarkEndToEndByteBuffer-32 1342 644 -52.01% BenchmarkEndToEndArrayByteBuffer 727725 671349 -7.75% BenchmarkEndToEndArrayByteBuffer-2 394079 320473 -18.68% BenchmarkEndToEndArrayByteBuffer-4 211785 178175 -15.87% BenchmarkEndToEndArrayByteBuffer-8 141003 118857 -15.71% BenchmarkEndToEndArrayByteBuffer-16 139249 86367 -37.98% BenchmarkEndToEndArrayByteBuffer-32 144128 73454 -49.04%

Patch Set 1 #

Patch Set 2 : diff -r b279bb7f7c3b96ac60ab8f618555b1b94e38be4a https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r b279bb7f7c3b96ac60ab8f618555b1b94e38be4a https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 4

Patch Set 4 : diff -r 6aa1064ad5644251c889157d948c0bec255d5984 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 0316cda6569c7b288ab1b9c41a0be62fcf68bf62 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r 0316cda6569c7b288ab1b9c41a0be62fcf68bf62 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -65 lines) Patch
M src/encoding/gob/encode.go View 1 7 chunks +37 lines, -38 lines 0 comments Download
M src/encoding/gob/encoder.go View 1 2 chunks +0 lines, -4 lines 0 comments Download
M src/encoding/gob/type.go View 1 2 3 3 chunks +53 lines, -23 lines 0 comments Download

Messages

Total messages: 5
dvyukov
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
11 years ago (2014-09-17 03:00:58 UTC) #1
r
https://codereview.appspot.com/147720043/diff/40001/src/encoding/gob/type.go File src/encoding/gob/type.go (right): https://codereview.appspot.com/147720043/diff/40001/src/encoding/gob/type.go#newcode691 src/encoding/gob/type.go:691: // It's updated using copy-on-write technique. Readers just do ...
11 years ago (2014-09-17 23:23:31 UTC) #2
dvyukov
PTAL https://codereview.appspot.com/147720043/diff/40001/src/encoding/gob/type.go File src/encoding/gob/type.go (right): https://codereview.appspot.com/147720043/diff/40001/src/encoding/gob/type.go#newcode691 src/encoding/gob/type.go:691: // It's updated using copy-on-write technique. Readers just ...
11 years ago (2014-09-18 03:40:59 UTC) #3
r
LGTM
11 years ago (2014-09-18 06:07:35 UTC) #4
dvyukov
11 years ago (2014-09-18 17:12:32 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=41418a795cb0 ***

encoding/gob: speedup encoding

Replace typeLock with copy-on-write map using atomic.Value.

benchmark                               old ns/op     new ns/op     delta
BenchmarkEndToEndPipe                   7722          7709          -0.17%
BenchmarkEndToEndPipe-2                 5114          4344          -15.06%
BenchmarkEndToEndPipe-4                 3192          2429          -23.90%
BenchmarkEndToEndPipe-8                 1833          1438          -21.55%
BenchmarkEndToEndPipe-16                1332          983           -26.20%
BenchmarkEndToEndPipe-32                1444          675           -53.25%
BenchmarkEndToEndByteBuffer             6474          6019          -7.03%
BenchmarkEndToEndByteBuffer-2           4280          2810          -34.35%
BenchmarkEndToEndByteBuffer-4           2264          1774          -21.64%
BenchmarkEndToEndByteBuffer-8           1275          979           -23.22%
BenchmarkEndToEndByteBuffer-16          1257          753           -40.10%
BenchmarkEndToEndByteBuffer-32          1342          644           -52.01%
BenchmarkEndToEndArrayByteBuffer        727725        671349        -7.75%
BenchmarkEndToEndArrayByteBuffer-2      394079        320473        -18.68%
BenchmarkEndToEndArrayByteBuffer-4      211785        178175        -15.87%
BenchmarkEndToEndArrayByteBuffer-8      141003        118857        -15.71%
BenchmarkEndToEndArrayByteBuffer-16     139249        86367         -37.98%
BenchmarkEndToEndArrayByteBuffer-32     144128        73454         -49.04%

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

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