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

Issue 11564044: code review 11564044: regexp: use a very fast random generator for benchmarks. (Closed)

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

Description

regexp: use a very fast random generator for benchmarks. Calls into math/rand are very slow, especially under race detector because of heap accesses. go test -bench . -run none -benchtime .1s Before: 23.0s After: 17.4s Fixes issue 5837.

Patch Set 1 #

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

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

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

Total comments: 1

Patch Set 5 : diff -r 353ca41927f1 https://go.googlecode.com/hg/ #

Total comments: 1

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

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

Messages

Total messages: 11
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 8 months ago (2013-07-19 06:42:57 UTC) #1
remyoudompheng
On 2013/07/19 06:42:57, remyoudompheng wrote: > Hello mailto:golang-dev@googlegroups.com (cc: mailto:golang-dev@googlegroups.com), > > I'd like you ...
10 years, 8 months ago (2013-07-19 06:44:18 UTC) #2
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
10 years, 8 months ago (2013-07-19 06:54:50 UTC) #3
dfc
On 2013/07/19 06:54:50, remyoudompheng wrote: > Hello mailto:golang-dev@googlegroups.com (cc: mailto:golang-dev@googlegroups.com), > > Please take another ...
10 years, 8 months ago (2013-07-19 07:38:44 UTC) #4
r
https://codereview.appspot.com/11564044/diff/8001/src/pkg/regexp/exec_test.go File src/pkg/regexp/exec_test.go (right): https://codereview.appspot.com/11564044/diff/8001/src/pkg/regexp/exec_test.go#newcode664 src/pkg/regexp/exec_test.go:664: } if you want fast... http://play.golang.org/p/W7ITvslaqV it's a fast ...
10 years, 8 months ago (2013-07-19 08:56:13 UTC) #5
r
x should be an int32 here. -rob
10 years, 8 months ago (2013-07-19 09:01:06 UTC) #6
remyoudompheng
Hello golang-dev@googlegroups.com, dave@cheney.net, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
10 years, 8 months ago (2013-07-20 09:05:45 UTC) #7
r
https://codereview.appspot.com/11564044/diff/17001/src/pkg/regexp/exec_test.go File src/pkg/regexp/exec_test.go (right): https://codereview.appspot.com/11564044/diff/17001/src/pkg/regexp/exec_test.go#newcode655 src/pkg/regexp/exec_test.go:655: x ^= 1 i don't understand why this is ...
10 years, 8 months ago (2013-07-20 12:16:00 UTC) #8
remyoudompheng
On 2013/07/20 12:16:00, r wrote: > https://codereview.appspot.com/11564044/diff/17001/src/pkg/regexp/exec_test.go > File src/pkg/regexp/exec_test.go (right): > > https://codereview.appspot.com/11564044/diff/17001/src/pkg/regexp/exec_test.go#newcode655 > ...
10 years, 8 months ago (2013-07-20 15:58:15 UTC) #9
r
LGTM
10 years, 8 months ago (2013-07-20 21:21:12 UTC) #10
remyoudompheng
10 years, 8 months ago (2013-07-20 21:33:51 UTC) #11
*** Submitted as https://code.google.com/p/go/source/detail?r=3bf9ffdcca1f ***

regexp: use a very fast random generator for benchmarks.

Calls into math/rand are very slow, especially under race
detector because of heap accesses.

go test -bench . -run none -benchtime .1s
Before: 23.0s
After:  17.4s

Fixes issue 5837.

R=golang-dev, dave, r
CC=golang-dev
https://codereview.appspot.com/11564044
Sign in to reply to this message.

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