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

Issue 37690045: code review 37690045: os: avoid a string concat in readdir (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by bradfitz
Modified:
12 years, 3 months ago
Reviewers:
crawshaw1, dave, iant
CC:
golang-dev, crawshaw1
Visibility:
Public.

Description

os: avoid a string concat in readdir

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -2 lines) Patch
M src/pkg/os/file_unix.go View 1 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 8
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 3 months ago (2013-12-17 20:21:41 UTC) #1
crawshaw1
LGTM
12 years, 3 months ago (2013-12-17 20:24:19 UTC) #2
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=455c7e94abfc *** os: avoid a string concat in readdir R=golang-dev, crawshaw CC=golang-dev ...
12 years, 3 months ago (2013-12-17 20:25:34 UTC) #3
dave_cheney.net
NOT LGTM. How is this better? You've gone from dirname += "/" outside the loop ...
12 years, 3 months ago (2013-12-17 21:08:03 UTC) #4
iant
On Tue, Dec 17, 2013 at 1:08 PM, Dave Cheney <dave@cheney.net> wrote: > > How ...
12 years, 3 months ago (2013-12-17 21:12:25 UTC) #5
bradfitz
On Tue, Dec 17, 2013 at 1:12 PM, Ian Lance Taylor <iant@golang.org> wrote: > On ...
12 years, 3 months ago (2013-12-17 21:14:14 UTC) #6
iant
On Tue, Dec 17, 2013 at 1:14 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > On Tue, ...
12 years, 3 months ago (2013-12-17 21:57:39 UTC) #7
dave_cheney.net
12 years, 3 months ago (2013-12-17 22:09:33 UTC) #8
Thanks, sorry for the noise. I'll check my facts next time. 

> On 18 Dec 2013, at 8:57, Ian Lance Taylor <iant@golang.org> wrote:
> 
>> On Tue, Dec 17, 2013 at 1:14 PM, Brad Fitzpatrick <bradfitz@golang.org>
wrote:
>>> On Tue, Dec 17, 2013 at 1:12 PM, Ian Lance Taylor <iant@golang.org> wrote:
>>> 
>>>> On Tue, Dec 17, 2013 at 1:08 PM, Dave Cheney <dave@cheney.net> wrote:
>>>> 
>>>> How is this better? You've gone from dirname += "/" outside the loop
>>>> to x := dirname + "/"; x += filename inside the loop.
>>> 
>>> The gc compiler optimizes a + b + c into a single operation: in this
>>> case it will generate code that passes all three strings to
>>> concatstring3.
>> 
>> 
>> Yeah. But what I forgot to consider (and don't know) was whether gccgo does
>> that too.
> 
> It doesn't.  But it's easy.
> 
> Ian
Sign in to reply to this message.

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