Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var median = require( './../lib' );
// MAIN //

bench( pkg, function benchmark( b ) {
var rand1;
var rand2;
var len;
var mu;
var c;
Expand All @@ -41,9 +43,13 @@ bench( pkg, function benchmark( b ) {
len = 100;
mu = new Float64Array( len );
c = new Float64Array( len );

rand1 = uniform.factory( -50.0, 50.0 );
rand2 = uniform.factory( EPS, 20.0 + EPS );

for ( i = 0; i < len; i++ ) {
mu[ i ] = uniform( -50.0, 50.0 );
c[ i ] = uniform( EPS, 20.0 + EPS );
mu[ i ] = rand1();
c[ i ] = rand2();
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,24 @@ var opts = {
// MAIN //

bench( pkg+'::native', opts, function benchmark( b ) {
var rand1;
var rand2;
var len;
var mu;
var c;
var y;
var c;
var i;

len = 100;
mu = new Float64Array( len );
c = new Float64Array( len );

rand1 = uniform.factory( -50.0, 50.0 );
rand2 = uniform.factory( EPS, 20.0 + EPS );

for ( i = 0; i < len; i++ ) {
mu[ i ] = uniform( -50.0, 50.0 );
c[ i ] = uniform( EPS, 20.0 + EPS );
mu[ i ] = rand1();
c[ i ] = rand2();
}

b.tic();
Expand Down