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

Issue 8478044: code review 8478044: time: add Time.FormatAppend (Closed)

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

Description

time: add Time.FormatAppend This is a version of Time.Format that doesn't require allocation. Fixes Issue 5192 Update Issue 5195

Patch Set 1 #

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

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

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

Total comments: 4

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

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

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

Messages

Total messages: 19
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 11 months ago (2013-05-14 14:55:00 UTC) #1
gobot
R=r (assigned by bradfitz)
10 years, 11 months ago (2013-05-14 22:14:42 UTC) #2
bradfitz
Reuploaded, since Rietveld was showing its fun corrupt patch message. Diff is tiny, but it ...
10 years, 11 months ago (2013-05-15 00:28:45 UTC) #3
r
https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go File src/pkg/time/format.go (right): https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go#newcode387 src/pkg/time/format.go:387: b = buf[:0] move the declaration of buf to ...
10 years, 11 months ago (2013-05-15 21:51:44 UTC) #4
bradfitz
https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go File src/pkg/time/format.go (right): https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go#newcode387 src/pkg/time/format.go:387: b = buf[:0] On 2013/05/15 21:51:44, r wrote: > ...
10 years, 11 months ago (2013-05-15 22:03:14 UTC) #5
r
https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go File src/pkg/time/format.go (right): https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go#newcode387 src/pkg/time/format.go:387: b = buf[:0] fair enough. it shouldn't allocate even ...
10 years, 11 months ago (2013-05-15 22:05:05 UTC) #6
bradfitz
PTAL https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go File src/pkg/time/format.go (right): https://codereview.appspot.com/8478044/diff/11001/src/pkg/time/format.go#newcode387 src/pkg/time/format.go:387: b = buf[:0] On 2013/05/15 22:05:05, r wrote: ...
10 years, 11 months ago (2013-05-15 22:18:41 UTC) #7
r
LGTM
10 years, 11 months ago (2013-05-16 00:04:00 UTC) #8
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=0d28fd55e721 *** time: add Time.FormatAppend This is a version of Time.Format that ...
10 years, 11 months ago (2013-05-16 00:24:28 UTC) #9
rsc
This function breaks the usual Go convention of putting the destination as the first argument ...
10 years, 11 months ago (2013-05-17 17:59:00 UTC) #10
r
Let's rethink this. Can we roll it back?
10 years, 11 months ago (2013-05-17 18:53:23 UTC) #11
bradfitz
Just decide what to name it and the argument order and I'll send a CL ...
10 years, 11 months ago (2013-05-17 19:03:13 UTC) #12
r
It's ugly. -rob
10 years, 11 months ago (2013-05-17 19:07:11 UTC) #13
bradfitz
Constructive. On May 17, 2013 12:07 PM, "Rob Pike" <r@golang.org> wrote: > It's ugly. > ...
10 years, 11 months ago (2013-05-17 19:14:14 UTC) #14
gustavo_niemeyer.net
On Fri, May 17, 2013 at 4:14 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > Constructive. Just ...
10 years, 11 months ago (2013-05-17 19:18:55 UTC) #15
rsc
It's a performance hack leaking into the API. Russ
10 years, 11 months ago (2013-05-17 19:50:16 UTC) #16
gustavo_niemeyer.net
On Fri, May 17, 2013 at 4:50 PM, Russ Cox <rsc@golang.org> wrote: > It's a ...
10 years, 11 months ago (2013-05-17 20:06:19 UTC) #17
bradfitz
Yeah, I have no clue what the rules are either. On Fri, May 17, 2013 ...
10 years, 11 months ago (2013-05-17 20:10:46 UTC) #18
rsc
10 years, 11 months ago (2013-05-17 20:11:47 UTC) #19
On Fri, May 17, 2013 at 4:05 PM, Gustavo Niemeyer <gustavo@niemeyer.net>wrote:

> On Fri, May 17, 2013 at 4:50 PM, Russ Cox <rsc@golang.org> wrote:
> > It's a performance hack leaking into the API.
>
> Isn't that the case all over the place? Why would we have
> strconv.Append*, or the bytes vs. string duplication all over the
> regexp package, or the special case of append(bytes, string...)?
>
> It's a genuine question, rather than a trolling one. I don't quite get
> where the line is.
>

reasonable people can disagree about where the line is.
AppendFormat is certainly somewhere near it.

russ
Sign in to reply to this message.

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