-
-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bench: refactor random value generation #5465
base: develop
Are you sure you want to change the base?
Changes from 1 commit
fffb21d
2f4b4ae
acadf4b
cfce2c1
03eea81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,15 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) { | |
var y; | ||
var r; | ||
var i; | ||
var j; | ||
|
||
x = uniform( 100, 1.0, 11.0 ); | ||
y = uniform( x.length, 1.0, 11.0 ); | ||
x = uniform( 100, 1, 11 ); | ||
y = uniform( 100, 1, 11 ); | ||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment |
||
|
||
b.tic(); | ||
for ( i = 0; i < b.iterations; i++ ) { | ||
j = i % x.length; | ||
r = boxcox( x[ j ], y[ j ] ); | ||
r = boxcox( x[ i%x.length ], y[ i%y.length ] ); | ||
if ( isnan( r ) ) { | ||
b.fail( 'should not return NaN' ); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,15 +34,13 @@ bench( pkg, function benchmark( b ) { | |
var y; | ||
var r; | ||
var i; | ||
var j; | ||
|
||
x = uniform( 100, 0.0, 10.0 ); | ||
y = uniform( x.length, 0.0, 10.0 ); | ||
x = uniform( 100, 0, 10 ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be This would help: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is expected throughout the PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one thing I don't understand when should I put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry I read it . |
||
y = uniform( 100, 0, 10 ); | ||
|
||
b.tic(); | ||
for ( i = 0; i < b.iterations; i++ ) { | ||
j = i % x.length; | ||
r = boxcoxinv( x[ j ], y[ j ] ); | ||
r = boxcoxinv( x[ i%x.length ], y[ i%y.length ] ); | ||
if ( isnan( r ) ) { | ||
b.fail( 'should not return NaN' ); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.