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

Issue 107190044: code review 107190044: strings: reduce allocation in byteStringReplacer.WriteString (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by ruiu
Modified:
11 years, 4 months ago
Reviewers:
bradfitz
CC:
golang-codereviews, bradfitz
Visibility:
Public.

Description

strings: reduce allocation in byteStringReplacer.WriteString Use WriteString instead of allocating a byte slice as a buffer. This was a TODO. benchmark old ns/op new ns/op delta BenchmarkWriteString 40139 19991 -50.20%

Patch Set 1 #

Patch Set 2 : diff -r 90c0d9c4a9ad https://code.google.com/p/go #

Patch Set 3 : diff -r 90c0d9c4a9ad https://code.google.com/p/go #

Patch Set 4 : diff -r 90c0d9c4a9ad https://code.google.com/p/go #

Patch Set 5 : diff -r 90c0d9c4a9ad https://code.google.com/p/go #

Total comments: 3

Patch Set 6 : diff -r f39dff1bf0d4 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -30 lines) Patch
M src/pkg/strings/replace.go View 1 2 3 1 chunk +14 lines, -30 lines 0 comments Download
M src/pkg/strings/replace_test.go View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 5
ruiu
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 4 months ago (2014-06-19 05:51:55 UTC) #1
bradfitz
LGTM https://codereview.appspot.com/107190044/diff/70001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/107190044/diff/70001/src/pkg/strings/replace.go#newcode434 src/pkg/strings/replace.go:434: if r.old[b>>5]&uint32(1<<(b&31)) != 0 { and here https://codereview.appspot.com/107190044/diff/70001/src/pkg/strings/replace.go#newcode459 ...
11 years, 4 months ago (2014-06-19 18:04:02 UTC) #2
ruiu
I'll do that in another CL as it's not related to it (and there are ...
11 years, 4 months ago (2014-06-19 18:13:13 UTC) #3
bradfitz
SGTM On Thu, Jun 19, 2014 at 11:13 AM, <ruiu@google.com> wrote: > I'll do that ...
11 years, 4 months ago (2014-06-19 18:13:39 UTC) #4
ruiu
11 years, 4 months ago (2014-06-19 18:22:53 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=d602aea40896 ***

strings: reduce allocation in byteStringReplacer.WriteString

Use WriteString instead of allocating a byte slice as a
buffer. This was a TODO.

benchmark               old ns/op    new ns/op    delta
BenchmarkWriteString        40139        19991  -50.20%

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/107190044
Sign in to reply to this message.

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