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

Issue 4817041: code review 4817041: io/ioutil: improve performance of ioutil.Discard (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years ago by msolo
Modified:
6 years ago
Reviewers:
CC:
bradfitz, rsc, golang-dev
Visibility:
Public.

Description

io/ioutil: improve performance of ioutil.Discard Fixes issue 2084.

Patch Set 1 #

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

Total comments: 2

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

Total comments: 2

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

Total comments: 2

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

Total comments: 2

Patch Set 6 : diff -r f2765b9aec9b https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -0 lines) Patch
M src/pkg/io/ioutil/ioutil.go View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 13
msolo
Hello bradfitz@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
6 years ago (2011-07-20 20:13:39 UTC) #1
rsc
> + junk := blackHole[0:cap(blackHole)] > + readSize, err = r.Read(junk) you can just say ...
6 years ago (2011-07-20 20:17:56 UTC) #2
bradfitz
http://codereview.appspot.com/4817041/diff/2001/src/pkg/io/ioutil/ioutil.go File src/pkg/io/ioutil/ioutil.go (right): http://codereview.appspot.com/4817041/diff/2001/src/pkg/io/ioutil/ioutil.go#newcode122 src/pkg/io/ioutil/ioutil.go:122: return n, nil why is there a for loop ...
6 years ago (2011-07-20 20:21:49 UTC) #3
msolo
Hello bradfitz@golang.org, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
6 years ago (2011-07-20 20:34:04 UTC) #4
bradfitz
http://codereview.appspot.com/4817041/diff/7001/src/pkg/io/ioutil/ioutil.go File src/pkg/io/ioutil/ioutil.go (right): http://codereview.appspot.com/4817041/diff/7001/src/pkg/io/ioutil/ioutil.go#newcode114 src/pkg/io/ioutil/ioutil.go:114: readSize := 0 you could ditch this line too ...
6 years ago (2011-07-20 20:36:57 UTC) #5
msolo
Hello bradfitz@golang.org, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
6 years ago (2011-07-20 21:02:41 UTC) #6
msolo
http://codereview.appspot.com/4817041/diff/2001/src/pkg/io/ioutil/ioutil.go File src/pkg/io/ioutil/ioutil.go (right): http://codereview.appspot.com/4817041/diff/2001/src/pkg/io/ioutil/ioutil.go#newcode122 src/pkg/io/ioutil/ioutil.go:122: return n, nil Good catch. I've fixed the loop. ...
6 years ago (2011-07-20 21:03:42 UTC) #7
bradfitz
http://codereview.appspot.com/4817041/diff/10001/src/pkg/io/ioutil/ioutil.go File src/pkg/io/ioutil/ioutil.go (right): http://codereview.appspot.com/4817041/diff/10001/src/pkg/io/ioutil/ioutil.go#newcode114 src/pkg/io/ioutil/ioutil.go:114: readSize := 0 either ditch this line, or... http://codereview.appspot.com/4817041/diff/10001/src/pkg/io/ioutil/ioutil.go#newcode122 ...
6 years ago (2011-07-20 21:12:14 UTC) #8
msolo
Hello bradfitz@golang.org, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
6 years ago (2011-07-20 21:15:19 UTC) #9
bradfitz
http://codereview.appspot.com/4817041/diff/14001/src/pkg/io/ioutil/ioutil.go File src/pkg/io/ioutil/ioutil.go (right): http://codereview.appspot.com/4817041/diff/14001/src/pkg/io/ioutil/ioutil.go#newcode120 src/pkg/io/ioutil/ioutil.go:120: return n, nil // err is EOF, so return ...
6 years ago (2011-07-20 21:17:16 UTC) #10
msolo
Hello bradfitz@golang.org, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
6 years ago (2011-07-20 21:20:36 UTC) #11
bradfitz
LGTM
6 years ago (2011-07-20 21:27:13 UTC) #12
bradfitz
6 years ago (2011-07-20 21:34:57 UTC) #13
*** Submitted as http://code.google.com/p/go/source/detail?r=13faa632ba3a ***

io/ioutil: improve performance of ioutil.Discard
Fixes issue 2084.

R=bradfitz, rsc
CC=golang-dev
http://codereview.appspot.com/4817041

Committer: Brad Fitzpatrick <bradfitz@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 80a51fa-tainted