-
-
Notifications
You must be signed in to change notification settings - Fork 910
fix: revert uniform implementation and remove unnecessary loop #5314
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
Changes from 1 commit
d40face
51f1262
a9c0b31
4e770ca
01c8685
e1aab4e
d70146b
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 | ||||
---|---|---|---|---|---|---|
|
@@ -46,10 +46,9 @@ bench( pkg+'::native', opts, function benchmark( b ) { | |||||
var i; | ||||||
|
||||||
len = 100; | ||||||
|
||||||
lambda = new Float64Array( len ); | ||||||
for ( i = 0; i < len; i++ ) { | ||||||
lambda[ i ] = uniform( 1.0, 10.0 ); | ||||||
} | ||||||
|
||||||
lambda = uniform(len, 0.1, 10.0); | ||||||
|
lambda = uniform(len, 0.1, 10.0); | |
lambda = uniform( 100, 0.1, 10.0 ); |
as per the suggested changes the var len
should be removed as the original implementation worked just fine.
Could you pls do the same for the benchmark.js
file as well.
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.
Just adding on to it, once the len
variable is removed, the initialization of y
in the benchmark loop will be updated to:
y = median( lambda[ i % lambda.length ] );
Basically, everything that was done in the original PR, as Neeraj already pointed out.
Uh oh!
There was an error while loading. Please reload this page.
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.
this should be removed as per the original implementation you will only be needing
@stdlib/random/array/uniform
.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.
@anandkaranubc what's your take on this?
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.
I agree. The latter one needs to be removed since it is no longer in use. Thanks for pointing that out!
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.
there is lint error in line no 39 , 42
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.
Yes, I believe clicking on the details should provide an overview for it.