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

Issue 5416046: code review 5416046: json: speed up encoding, caching reflect calls (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by bradfitz
Modified:
13 years, 3 months ago
Reviewers:
CC:
rsc, r, golang-dev
Visibility:
Public.

Description

json: speed up encoding, caching reflect calls Before json.BenchmarkCodeEncoder 10 181232100 ns/op 10.71 MB/s json.BenchmarkCodeMarshal 10 184578000 ns/op 10.51 MB/s After: json.BenchmarkCodeEncoder 10 146444000 ns/op 13.25 MB/s json.BenchmarkCodeMarshal 10 151428500 ns/op 12.81 MB/s

Patch Set 1 #

Patch Set 2 : diff -r 4382717b7ffc https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 4382717b7ffc https://go.googlecode.com/hg/ #

Total comments: 4

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -23 lines) Patch
M src/pkg/encoding/json/encode.go View 1 2 3 4 chunks +66 lines, -23 lines 0 comments Download

Messages

Total messages: 11
bradfitz
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 4 months ago (2011-11-18 14:40:55 UTC) #1
rsc
This seems reasonable but maybe is not enough? I was wondering if there should just ...
13 years, 4 months ago (2011-11-18 15:48:23 UTC) #2
bradfitz
Hello golang-dev@googlegroups.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 3 months ago (2011-11-20 16:49:29 UTC) #3
bradfitz
PTAL. I took it further, but just for encode so far. I initially tried like ...
13 years, 3 months ago (2011-11-20 16:58:11 UTC) #4
r
This is just a cache. The package needs a rewrite. This change is OK, but ...
13 years, 3 months ago (2011-11-20 17:47:41 UTC) #5
bradfitz
On Sun, Nov 20, 2011 at 12:47 PM, <r@golang.org> wrote: > This is just a ...
13 years, 3 months ago (2011-11-20 17:59:17 UTC) #6
rsc
http://codereview.appspot.com/5416046/diff/4001/src/pkg/encoding/json/encode.go File src/pkg/encoding/json/encode.go (right): http://codereview.appspot.com/5416046/diff/4001/src/pkg/encoding/json/encode.go#newcode201 src/pkg/encoding/json/encode.go:201: // tagCache is a cache of seen StructTag's "json" ...
13 years, 3 months ago (2011-11-21 15:06:50 UTC) #7
bradfitz
Hello rsc@golang.org, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 3 months ago (2011-11-21 15:25:18 UTC) #8
bradfitz
PTAL http://codereview.appspot.com/5416046/diff/4001/src/pkg/encoding/json/encode.go File src/pkg/encoding/json/encode.go (right): http://codereview.appspot.com/5416046/diff/4001/src/pkg/encoding/json/encode.go#newcode201 src/pkg/encoding/json/encode.go:201: // tagCache is a cache of seen StructTag's ...
13 years, 3 months ago (2011-11-21 15:25:54 UTC) #9
rsc
LGTM
13 years, 3 months ago (2011-11-21 15:43:38 UTC) #10
bradfitz
13 years, 3 months ago (2011-11-21 15:49:18 UTC) #11
*** Submitted as http://code.google.com/p/go/source/detail?r=4a5b249ef23d ***

json: speed up encoding, caching reflect calls

Before
json.BenchmarkCodeEncoder  10  181232100 ns/op  10.71 MB/s
json.BenchmarkCodeMarshal  10  184578000 ns/op  10.51 MB/s

After:
json.BenchmarkCodeEncoder  10  146444000 ns/op  13.25 MB/s
json.BenchmarkCodeMarshal  10  151428500 ns/op  12.81 MB/s

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

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