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

Issue 7458043: code review 7458043: strings: optimized "explode" method to be 3 times faster. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by Ewan Chou
Modified:
11 years, 1 month ago
Reviewers:
CC:
golang-dev, rsc, minux1, dave_cheney.net, extemporalgenome
Visibility:
Public.

Description

windows 7/amd64 benchmark old ns/op new ns/op delta BenchmarkSplit1 77984460 24131380 -69.06% BenchmarkSplit2 5222298 5802331 +11.11% BenchmarkSplit3 4038231 4024230 -0.35%

Patch Set 1 #

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

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

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

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

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

Patch Set 7 : diff -r b0c8d47acfc5 https://code.google.com/p/go #

Patch Set 8 : diff -r b0c8d47acfc5 https://code.google.com/p/go #

Patch Set 9 : diff -r b0c8d47acfc5 https://code.google.com/p/go #

Patch Set 10 : diff -r b0c8d47acfc5 https://code.google.com/p/go #

Patch Set 11 : diff -r b0c8d47acfc5 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -1 line) Patch
M src/pkg/strings/strings.go View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -1 line 0 comments Download
M src/pkg/strings/strings_test.go View 1 2 3 6 7 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 42
Ewan Chou
11 years, 1 month ago (2013-03-01 09:10:25 UTC) #1
rsc
If you write string(utf8.RuneError) you'll get rid of the remaining allocation too.
11 years, 1 month ago (2013-03-01 14:26:26 UTC) #2
Ewan Chou
On 2013/03/01 14:26:26, rsc wrote: > If you write string(utf8.RuneError) you'll get rid of the ...
11 years, 1 month ago (2013-03-01 15:34:51 UTC) #3
Ewan Chou
On 2013/03/01 15:34:51, Ewan Chou wrote: > On 2013/03/01 14:26:26, rsc wrote: > > If ...
11 years, 1 month ago (2013-03-01 15:37:05 UTC) #4
Ewan Chou
On 2013/03/01 15:37:05, Ewan Chou wrote: > On 2013/03/01 15:34:51, Ewan Chou wrote: > > ...
11 years, 1 month ago (2013-03-01 16:16:40 UTC) #5
minux1
On Fri, Mar 1, 2013 at 11:37 PM, <coocood@gmail.com> wrote: > On 2013/03/01 15:34:51, Ewan ...
11 years, 1 month ago (2013-03-01 19:12:38 UTC) #6
dave_cheney.net
Use hg upload 7458043 To upload a new diff. Use hg mail 7458043 When you ...
11 years, 1 month ago (2013-03-01 20:51:37 UTC) #7
Ewan Chou
On 2013/03/01 19:12:38, minux wrote: > On Fri, Mar 1, 2013 at 11:37 PM, <mailto:coocood@gmail.com> ...
11 years, 1 month ago (2013-03-02 02:33:12 UTC) #8
dave_cheney.net
Oh, could you please add some benchmarks as part of this CL? Sent from my ...
11 years, 1 month ago (2013-03-02 02:37:22 UTC) #9
Ewan Chou
Added three benchmark functions for Split method. On 2013/03/02 02:37:22, dfc wrote: > Oh, could ...
11 years, 1 month ago (2013-03-02 03:08:13 UTC) #10
dave_cheney.net
Can you please do this to report the benchmark delta. 1. go test -bench=Split > ...
11 years, 1 month ago (2013-03-02 03:14:29 UTC) #11
Ewan Chou
On 2013/03/02 03:14:29, dfc wrote: > Can you please do this to report the benchmark ...
11 years, 1 month ago (2013-03-02 04:17:08 UTC) #12
Ewan Chou
On 2013/03/02 04:17:08, Ewan Chou wrote: > On 2013/03/02 03:14:29, dfc wrote: > > Can ...
11 years, 1 month ago (2013-03-02 06:36:30 UTC) #13
dave_cheney.net
What OS are you benchmarking on ? On 02/03/2013, at 17:36, coocood@gmail.com wrote: > On ...
11 years, 1 month ago (2013-03-02 06:51:20 UTC) #14
Ewan Chou
On 2013/03/02 06:51:20, dfc wrote: > What OS are you benchmarking on ? Windows 7 ...
11 years, 1 month ago (2013-03-02 06:53:57 UTC) #15
dave_cheney.net
Fair enough, using pprof on windows is quite hard, I was going to say do ...
11 years, 1 month ago (2013-03-02 06:56:23 UTC) #16
rsc
The code looks fine to me, and the benchmarks are fine too. 5% due to ...
11 years, 1 month ago (2013-03-04 15:05:51 UTC) #17
Ewan Chou
On 2013/03/04 15:05:51, rsc wrote: > The code looks fine to me, and the benchmarks ...
11 years, 1 month ago (2013-03-04 15:15:33 UTC) #18
rsc
No, see my comments on the other issue. I'm willing to get the explode change ...
11 years, 1 month ago (2013-03-04 15:36:20 UTC) #19
Ewan Chou
On 2013/03/04 15:36:20, rsc wrote: > No, see my comments on the other issue. I'm ...
11 years, 1 month ago (2013-03-04 15:43:13 UTC) #20
Ewan Chou
On 2013/03/04 15:43:13, Ewan Chou wrote: > On 2013/03/04 15:36:20, rsc wrote: > > No, ...
11 years, 1 month ago (2013-03-04 15:59:05 UTC) #21
Ewan Chou
On 2013/03/04 15:59:05, Ewan Chou wrote: > On 2013/03/04 15:43:13, Ewan Chou wrote: > > ...
11 years, 1 month ago (2013-03-04 16:59:13 UTC) #22
Ewan Chou
Hello golang-dev@googlegroups.com, rsc@golang.org, minux.ma@gmail.com, dave@cheney.net (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
11 years, 1 month ago (2013-03-05 09:54:25 UTC) #23
dave_cheney.net
linux/amd64, tip lucky(~/go/src/pkg/strings) % ~/go/misc/benchcmp {old,new}.txt benchmark old ns/op new ns/op delta BenchmarkSplit1 100105364 27815460 ...
11 years, 1 month ago (2013-03-06 03:09:41 UTC) #24
dave_cheney.net
While this is a great speedup in Split1 (and also a huge reduction in allocs/op), ...
11 years, 1 month ago (2013-03-06 03:12:43 UTC) #25
Ewan Chou
On 2013/03/06 03:12:43, dfc wrote: > While this is a great speedup in Split1 (and ...
11 years, 1 month ago (2013-03-06 03:32:53 UTC) #26
Ewan Chou
On 2013/03/06 03:32:53, Ewan Chou wrote: > On 2013/03/06 03:12:43, dfc wrote: > > While ...
11 years, 1 month ago (2013-03-06 03:40:33 UTC) #27
dave_cheney.net
I think it is benchmarking inside a VM. On Tue, Mar 5, 2013 at 10:40 ...
11 years, 1 month ago (2013-03-06 03:44:42 UTC) #28
Ewan Chou
On 2013/03/06 03:44:42, dfc wrote: > I think it is benchmarking inside a VM. > ...
11 years, 1 month ago (2013-03-06 03:46:55 UTC) #29
Ewan Chou
I know some Chinese applications use explode extensively. For none-ASCII text, there is no other ...
11 years, 1 month ago (2013-03-06 04:02:05 UTC) #30
Ewan Chou
On 2013/03/06 04:02:05, Ewan Chou wrote: > I know some Chinese applications use explode extensively. ...
11 years, 1 month ago (2013-03-06 04:13:03 UTC) #31
rsc
I'm sorry, but this is too much fine detail to worry about this close to ...
11 years, 1 month ago (2013-03-06 04:26:43 UTC) #32
Ewan Chou
On 2013/03/06 04:26:43, rsc wrote: > I'm sorry, but this is too much fine detail ...
11 years, 1 month ago (2013-03-06 04:31:59 UTC) #33
Ewan Chou
Hello golang-dev@googlegroups.com, rsc@golang.org, minux.ma@gmail.com, dave@cheney.net (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 1 month ago (2013-03-06 04:37:38 UTC) #34
rsc
Looks good. Please update the benchmarks.
11 years, 1 month ago (2013-03-06 04:46:28 UTC) #35
Ewan Chou
On 2013/03/06 04:46:28, rsc wrote: > Looks good. Please update the benchmarks. benchmark updated, sadly ...
11 years, 1 month ago (2013-03-06 05:10:24 UTC) #36
extemporalgenome
Even though it's an error case, would globally setting: const runeErrString = string(utf8.RuneError) have any ...
11 years, 1 month ago (2013-03-06 05:50:01 UTC) #37
extemporalgenome
I didn't actually mean "globally" -- just meant constant. On Tuesday, March 5, 2013 10:50:00 ...
11 years, 1 month ago (2013-03-06 07:08:35 UTC) #38
Ewan Chou
On 2013/03/06 07:08:35, extemporalgenome wrote: > I didn't actually mean "globally" -- just meant constant. ...
11 years, 1 month ago (2013-03-06 08:28:02 UTC) #39
Ewan Chou
If I moves the declaration of "ch" and "size" into the loop, the delta drops ...
11 years, 1 month ago (2013-03-06 13:04:06 UTC) #40
rsc
LGTM Don't worry about Split2. That's not this CL.
11 years, 1 month ago (2013-03-06 20:21:11 UTC) #41
rsc
11 years, 1 month ago (2013-03-06 20:21:25 UTC) #42
*** Submitted as https://code.google.com/p/go/source/detail?r=d9a5413ba789 ***

strings: remove allocations in Split(s, "")

BenchmarkSplit1     77984460     24131380  -69.06%

R=golang-dev, rsc, minux.ma, dave, extemporalgenome
CC=golang-dev
https://codereview.appspot.com/7458043

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

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