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

Issue 6348061: code review 6348061: math/rand: avoid use of math.Pow in tests. (Closed)

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

Description

math/rand: avoid use of math.Pow in tests. The use of math.Pow for mere squaring can be extremely slow on soft-float ARM. Even on systems with hardware floating-point, a speedup in test duration is observed. On amd64 Before: ok math/rand 2.009s After: ok math/rand 0.340s Fixes issue 3740.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -8 lines) Patch
M src/pkg/math/rand/rand_test.go View 1 1 chunk +5 lines, -8 lines 0 comments Download

Messages

Total messages: 6
dave_cheney.net
Wow. I can't believe it made that much difference. Also, fixes issue 6304087. dfc@qnap:~/go/src/pkg/math$ time ...
11 years, 10 months ago (2012-07-02 10:47:07 UTC) #1
remyoudompheng
Hello dave@cheney.net, golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 10 months ago (2012-07-03 22:20:54 UTC) #2
r
LGTM oh my
11 years, 10 months ago (2012-07-03 22:25:27 UTC) #3
dave_cheney.net
@r, do you think this change, http://codereview.appspot.com/6351058/, developed at the same, is worth proposing as ...
11 years, 10 months ago (2012-07-03 22:27:35 UTC) #4
r2
On Jul 3, 2012, at 3:27 PM, Dave Cheney wrote: > @r, do you think ...
11 years, 10 months ago (2012-07-03 22:35:12 UTC) #5
remyoudompheng
11 years, 10 months ago (2012-07-03 22:38:14 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=0f3410fdeb91 ***

math/rand: avoid use of math.Pow in tests.

The use of math.Pow for mere squaring can be extremely
slow on soft-float ARM. Even on systems with hardware
floating-point, a speedup in test duration is observed.

On amd64
Before: ok      math/rand       2.009s
After:  ok      math/rand       0.340s

Fixes issue 3740.

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

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