Skip to content

Commit d650d02

Browse files
committed
bench: make consistent & worst case scenario
--- 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 fa9ef2a commit d650d02

11 files changed

+16
-16
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var order = 'column-major';
4646
* @returns {boolean} result
4747
*/
4848
function clbk( value ) {
49-
return value % 2.0 === 0.0;
49+
return value < 0.0;
5050
}
5151

5252
/**
@@ -59,8 +59,8 @@ function clbk( value ) {
5959
* @returns {Function} benchmark function
6060
*/
6161
function createBenchmark( len, shape, xtype ) {
62+
var sv;
6263
var x;
63-
var v;
6464

6565
x = discreteUniform( len, 1, 100 );
6666
x = {
@@ -71,7 +71,7 @@ function createBenchmark( len, shape, xtype ) {
7171
'offset': 0,
7272
'order': order
7373
};
74-
v = {
74+
sv = {
7575
'dtype': xtype,
7676
'data': [ -1.0 ],
7777
'shape': [],
@@ -93,7 +93,7 @@ function createBenchmark( len, shape, xtype ) {
9393

9494
b.tic();
9595
for ( i = 0; i < b.iterations; i++ ) {
96-
out = find( [ x, v ], clbk );
96+
out = find( [ x, sv ], clbk );
9797
if ( isnan( out ) ) {
9898
b.fail( 'should not return NaN' );
9999
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var order = 'row-major';
4646
* @returns {boolean} result
4747
*/
4848
function clbk( value ) {
49-
return value % 2.0 === 0.0;
49+
return value < 0.0;
5050
}
5151

5252
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'column-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'row-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**
@@ -86,7 +86,7 @@ function createBenchmark( len, shape, xtype ) {
8686

8787
b.tic();
8888
for ( i = 0; i < b.iterations; i++ ) {
89-
out = find( x, 101, clbk );
89+
out = find( x, -1, clbk );
9090
if ( isnan( out ) ) {
9191
b.fail( 'should not return NaN' );
9292
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'column-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**
@@ -86,7 +86,7 @@ function createBenchmark( len, shape, xtype ) {
8686

8787
b.tic();
8888
for ( i = 0; i < b.iterations; i++ ) {
89-
out = find( x, 101, clbk );
89+
out = find( x, -1, clbk );
9090
if ( isnan( out ) ) {
9191
b.fail( 'should not return NaN' );
9292
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'row-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'row-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'column-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'row-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var order = 'column-major';
4848
* @returns {boolean} result
4949
*/
5050
function clbk( value ) {
51-
return value % 2.0 === 0.0;
51+
return value < 0.0;
5252
}
5353

5454
/**

0 commit comments

Comments
 (0)