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

Issue 5992058: code review 5992058: time: in Format give buffer an initial capacity

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

Description

time: in Format give buffer an initial capacity I have a small web server that simply sets several cookies along with an expires header, and then returns. In the cpuprofile for a 200k request benchmark, time.Time.Format() was showing up as 8.3% of cpu usage. Giving the buffer an inital capacity to avoid reallocs on append drops it down to 7.6%.

Patch Set 1 #

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

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

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

Messages

Total messages: 3
bpowers
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
8 years, 4 months ago (2012-04-06 21:18:41 UTC) #1
r
LGTM
8 years, 4 months ago (2012-04-07 00:47:43 UTC) #2
r
8 years, 4 months ago (2012-04-07 00:51:58 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=d9e4f47ae341 ***

time: in Format give buffer an initial capacity

I have a small web server that simply sets several cookies
along with an expires header, and then returns.  In the
cpuprofile for a 200k request benchmark, time.Time.Format()
was showing up as 8.3% of cpu usage.  Giving the buffer an
inital capacity to avoid reallocs on append drops it down to
7.6%.

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/5992058

Committer: Rob Pike <r@golang.org>
Sign in to reply to this message.

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