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

Issue 102550043: code review 102550043: strings: speed up byteReplacer.Replace (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 12 months ago by ruiu
Modified:
10 years, 11 months ago
Reviewers:
dave
CC:
golang-codereviews, dave_cheney.net
Visibility:
Public.

Description

strings: speed up byteReplacer.Replace benchmark old ns/op new ns/op delta BenchmarkByteReplacerWriteString 7359 3661 -50.25%

Patch Set 1 #

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

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

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

Total comments: 11

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -6 lines) Patch
M src/pkg/strings/replace.go View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M src/pkg/strings/replace_test.go View 1 2 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 11
ruiu
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 12 months ago (2014-06-20 03:14:56 UTC) #1
dave_cheney.net
https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode55 src/pkg/strings/replace.go:55: bb := &byteReplacer{} var bb byteReplacer https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode57 src/pkg/strings/replace.go:57: bb.new[i] ...
10 years, 12 months ago (2014-06-20 06:37:07 UTC) #2
ruiu
https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode55 src/pkg/strings/replace.go:55: bb := &byteReplacer{} What's the point of this change? ...
10 years, 12 months ago (2014-06-20 06:52:28 UTC) #3
dave_cheney.net
https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode55 src/pkg/strings/replace.go:55: bb := &byteReplacer{} On 2014/06/20 06:52:28, ruiu wrote: > ...
10 years, 12 months ago (2014-06-20 06:57:52 UTC) #4
ruiu
https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode55 src/pkg/strings/replace.go:55: bb := &byteReplacer{} Sounds like it's a good thing ...
10 years, 12 months ago (2014-06-20 07:01:00 UTC) #5
dave_cheney.net
https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode57 src/pkg/strings/replace.go:57: bb.new[i] = byte(i) on linux/arm, changing this to bb.new[i&0xff] ...
10 years, 12 months ago (2014-06-20 07:31:27 UTC) #6
ruiu
https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go File src/pkg/strings/replace.go (right): https://codereview.appspot.com/102550043/diff/60001/src/pkg/strings/replace.go#newcode57 src/pkg/strings/replace.go:57: bb.new[i] = byte(i) Why did that change make such ...
10 years, 12 months ago (2014-06-20 07:58:05 UTC) #7
dave_cheney.net
I think I was not clear, the best result came from bb.new[i&0xff] = byte(i) but ...
10 years, 12 months ago (2014-06-20 07:59:40 UTC) #8
ruiu
Ah, my interpretation was wrong. I misinterpreted "old" column is the result of this patch ...
10 years, 12 months ago (2014-06-20 08:06:50 UTC) #9
dave_cheney.net
LGTM. That sounds fair On Fri, Jun 20, 2014 at 6:06 PM, <ruiu@google.com> wrote: > ...
10 years, 12 months ago (2014-06-20 08:13:06 UTC) #10
ruiu
10 years, 11 months ago (2014-06-20 19:18:48 UTC) #11
*** Submitted as https://code.google.com/p/go/source/detail?r=cbfdea2b0ebb ***

strings: speed up byteReplacer.Replace

benchmark                         old ns/op    new ns/op    delta
BenchmarkByteReplacerWriteString       7359         3661  -50.25%

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

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