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

Issue 5623053: code review 5623053: In json.NewDecoder: if the paramter is also a io.ByteRe...

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by Nan Deng
Modified:
12 years, 2 months ago
Reviewers:
golang-dev
CC:
golang-dev, iant, rsc
Visibility:
Public.

Description

In json.NewDecoder: if the paramter is also a io.ByteReader, then only read one byte each time to avoid "over-feeding". Added a test case to test if the Decoder will over feeding. (Nearly a verbatim copy from jdnurmi@qwe.cc, the reporter of issue 1955) Fixes issue 1955

Patch Set 1 #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -0 lines) Patch
M src/pkg/encoding/json/decode_test.go View 1 1 chunk +15 lines, -0 lines 0 comments Download
M src/pkg/encoding/json/stream.go View 1 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 3
Nan Deng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, iant@golang.org, rsc@golang.org), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 2 months ago (2012-02-03 06:57:34 UTC) #1
rsc
I am worried that this wrapping will hurt the performance of json decoding. It might ...
12 years, 2 months ago (2012-02-06 17:26:21 UTC) #2
Nan Deng
12 years, 2 months ago (2012-02-07 01:19:15 UTC) #3
Russ Cox wrote, On 02/06/2012 12:26 PM:
> I am worried that this wrapping will hurt the performance of json decoding.
> It might be necessary to have two different input loops, one using
> Read and one using ReadByte.

I see. Performance definitely deserves a concern.

I will try several possible solutions then run the benchmark on each of 
them. And submit another CL with the best solution.

Thanks!

-Nan
>
> Russ
>

Sign in to reply to this message.

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