Skip to content

Commit 5dc4859

Browse files
committed
bench: apply suggestions from code review
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c62bd4d commit 5dc4859

11 files changed

+37
-13
lines changed

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.1d_columnmajor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var isInteger = require( '@stdlib/math/base/assert/is-integer' );
2727
var pow = require( '@stdlib/math/base/special/pow' );
2828
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2929
var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
30+
var filledarray = require( '@stdlib/array/filled' );
3031
var pkg = require( './../package.json' ).name;
3132
var find = require( './../lib' );
3233

@@ -62,7 +63,9 @@ function createBenchmark( len, shape, xtype ) {
6263
var sv;
6364
var x;
6465

65-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6669
x = {
6770
'dtype': xtype,
6871
'data': x,
@@ -73,7 +76,7 @@ function createBenchmark( len, shape, xtype ) {
7376
};
7477
sv = {
7578
'dtype': xtype,
76-
'data': [ NaN ],
79+
'data': filledarray( NaN, 1, xtype ),
7780
'shape': [],
7881
'strides': [ 0 ],
7982
'offset': 0,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.1d_rowmajor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var isInteger = require( '@stdlib/math/base/assert/is-integer' );
2727
var pow = require( '@stdlib/math/base/special/pow' );
2828
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2929
var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
30+
var filledarray = require( '@stdlib/array/filled' );
3031
var pkg = require( './../package.json' ).name;
3132
var find = require( './../lib' );
3233

@@ -62,7 +63,9 @@ function createBenchmark( len, shape, xtype ) {
6263
var sv;
6364
var x;
6465

65-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6669
x = {
6770
'dtype': xtype,
6871
'data': x,
@@ -73,7 +76,7 @@ function createBenchmark( len, shape, xtype ) {
7376
};
7477
sv = {
7578
'dtype': xtype,
76-
'data': [ NaN ],
79+
'data': filledarray( NaN, 1, xtype ),
7780
'shape': [],
7881
'strides': [ 0 ],
7982
'offset': 0,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.2d_blocked_columnmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.2d_blocked_rowmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.2d_columnmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.2d_rowmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.2d_rowmajor_accessors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function set( buf, idx, value ) {
8787
function createBenchmark( len, shape, xtype ) {
8888
var x;
8989

90-
x = discreteUniform( len, 1, 100 );
90+
x = discreteUniform( len, 1, 100, {
91+
'dtype': xtype
92+
});
9193
x = {
9294
'dtype': xtype,
9395
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.3d_blocked_columnmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.3d_blocked_rowmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

lib/node_modules/@stdlib/ndarray/base/find/benchmark/benchmark.3d_columnmajor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function clbk( value ) {
6363
function createBenchmark( len, shape, xtype ) {
6464
var x;
6565

66-
x = discreteUniform( len, 1, 100 );
66+
x = discreteUniform( len, 1, 100, {
67+
'dtype': xtype
68+
});
6769
x = {
6870
'dtype': xtype,
6971
'data': x,

0 commit comments

Comments
 (0)