Skip to content

Commit 721ba1b

Browse files
committed
Auto-generated commit
1 parent 23033c4 commit 721ba1b

File tree

5 files changed

+29
-36
lines changed

5 files changed

+29
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-01-05)
7+
## Unreleased (2026-01-07)
88

99
<section class="features">
1010

@@ -34,6 +34,7 @@ This release closes the following issue:
3434

3535
<details>
3636

37+
- [`75552e8`](https://github.com/stdlib-js/stdlib/commit/75552e80fb02f81854f91d7361586a661d6b377e) - **bench:** update random value generation [(#9589)](https://github.com/stdlib-js/stdlib/pull/9589) _(by Harsh Yadav)_
3738
- [`a27671f`](https://github.com/stdlib-js/stdlib/commit/a27671f8fc907e4f054086e3e422234ed56964cd) - **docs:** update string interpolation in various `stats/base/dists` examples [(#9533)](https://github.com/stdlib-js/stdlib/pull/9533) _(by Harsh Yadav)_
3839
- [`fc438e0`](https://github.com/stdlib-js/stdlib/commit/fc438e0edbad0689d6923d6f3edb959b96597662) - **test:** use standardized assertion messages and fix lint errors _(by Philipp Burckhardt)_
3940
- [`07f7c05`](https://github.com/stdlib-js/stdlib/commit/07f7c0522c73e6ad9505e1d45035ae439344200d) - **test:** use standardized assertion messages and fix lint errors _(by Philipp Burckhardt)_

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Copyright (c) 2016-2025 The Stdlib Authors.
1+
Copyright (c) 2016-2026 The Stdlib Authors.

benchmark/benchmark.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var Float64Array = require( '@stdlib/array-float64' );
25-
var uniform = require( '@stdlib/random-base-uniform' );
26-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
25+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
2726
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2827
var pkg = require( './../package.json' ).name;
2928
var pmf = require( './../lib' );
@@ -32,23 +31,21 @@ var pmf = require( './../lib' );
3231
// MAIN //
3332

3433
bench( pkg, function benchmark( b ) {
35-
var len;
34+
var opts;
3635
var mu;
3736
var x;
3837
var y;
3938
var i;
4039

41-
len = 100;
42-
x = new Float64Array( len );
43-
mu = new Float64Array( len );
44-
for ( i = 0; i < len; i++ ) {
45-
x[ i ] = discreteUniform( -100, 0 );
46-
mu[ i ] = uniform( -50.0, 50.0 );
47-
}
40+
opts = {
41+
'dtype': 'float64'
42+
};
43+
x = uniform( 100, -100.0, 0.0, opts );
44+
mu = uniform( 100, -50.0, 50.0, opts );
4845

4946
b.tic();
5047
for ( i = 0; i < b.iterations; i++ ) {
51-
y = pmf( x[ i % len ], mu[ i % len ] );
48+
y = pmf( x[ i % x.length ], mu[ i % mu.length ] );
5249
if ( isnan( y ) ) {
5350
b.fail( 'should not return NaN' );
5451
}
@@ -63,23 +60,23 @@ bench( pkg, function benchmark( b ) {
6360

6461
bench( pkg+':factory', function benchmark( b ) {
6562
var mypmf;
66-
var len;
63+
var opts;
6764
var mu;
6865
var x;
6966
var y;
7067
var i;
7168

7269
mu = 40.0;
7370
mypmf = pmf.factory( mu );
74-
len = 100;
75-
x = new Float64Array( len );
76-
for ( i = 0; i < len; i++ ) {
77-
x[ i ] = discreteUniform( 0, 100 );
78-
}
71+
72+
opts = {
73+
'dtype': 'float64'
74+
};
75+
x = discreteUniform( 100, 0.0, 100.0, opts );
7976

8077
b.tic();
8178
for ( i = 0; i < b.iterations; i++ ) {
82-
y = mypmf( x[ i % len ] );
79+
y = mypmf( x[ i % x.length ] );
8380
if ( isnan( y ) ) {
8481
b.fail( 'should not return NaN' );
8582
}

benchmark/benchmark.native.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench-harness' );
25-
var Float64Array = require( '@stdlib/array-float64' );
26-
var uniform = require( '@stdlib/random-base-uniform' );
27-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
25+
var uniform = require( '@stdlib/random-array-uniform' );
26+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
2827
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2928
var tryRequire = require( '@stdlib/utils-try-require' );
3029
var pkg = require( './../package.json' ).name;
@@ -41,23 +40,21 @@ var opts = {
4140
// MAIN //
4241

4342
bench( pkg+'::native', opts, function benchmark( b ) {
44-
var len;
43+
var opts;
4544
var mu;
4645
var x;
4746
var y;
4847
var i;
4948

50-
len = 100;
51-
x = new Float64Array( len );
52-
mu = new Float64Array( len );
53-
for ( i = 0; i < len; i++ ) {
54-
x[ i ] = discreteUniform( -100, 0 );
55-
mu[ i ] = uniform( -50.0, 50.0 );
56-
}
49+
opts = {
50+
'dtype': 'float64'
51+
};
52+
x = discreteUniform( 100, -100, 0, opts );
53+
mu = uniform( 100, -50.0, 50.0, opts );
5754

5855
b.tic();
5956
for ( i = 0; i < b.iterations; i++ ) {
60-
y = pmf( x[ i % len ], mu[ i % len ] );
57+
y = pmf( x[ i % x.length ], mu[ i % mu.length ] );
6158
if ( isnan( y ) ) {
6259
b.fail( 'should not return NaN' );
6360
}

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@
4747
"@stdlib/utils-library-manifest": "^0.2.2"
4848
},
4949
"devDependencies": {
50-
"@stdlib/array-float64": "^0.2.2",
5150
"@stdlib/console-log-each-map": "github:stdlib-js/console-log-each-map#main",
5251
"@stdlib/math-base-special-ceil": "^0.2.2",
5352
"@stdlib/math-base-special-round": "^0.3.0",
5453
"@stdlib/random-array-discrete-uniform": "^0.2.1",
55-
"@stdlib/random-base-discrete-uniform": "^0.2.1",
56-
"@stdlib/random-base-uniform": "^0.2.1",
54+
"@stdlib/random-array-uniform": "^0.2.1",
5755
"@stdlib/utils-try-require": "^0.2.2",
5856
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5957
"istanbul": "^0.4.1",

0 commit comments

Comments
 (0)