Skip to content

Commit 986734b

Browse files
committed
bench: apply review changes
--- 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 cfbcdaf commit 986734b

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

lib/node_modules/@stdlib/lapack/base/dlartv/benchmark/benchmark.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,25 @@ function createBenchmark( len ) {
5252

5353
return benchmark;
5454

55+
/**
56+
* Benchmark function.
57+
*
58+
* @private
59+
* @param {Benchmark} b - benchmark instance
60+
*/
5561
function benchmark( b ) {
62+
var z;
5663
var i;
5764

5865
b.tic();
5966
for ( i = 0; i < b.iterations; i++ ) {
60-
X = uniform( len, -10.0, 10.0, options );
61-
Y = uniform( len, -10.0, 10.0, options );
62-
Y = dlartv( len, X, 1, Y, 1, C, S, 1 );
63-
if ( isnan( Y[ i%Y.length ] ) ) {
67+
z = dlartv( len, X, 1, Y, 1, C, S, 1 );
68+
if ( isnan( z[ i%X.length ] ) ) {
6469
b.fail( 'should not return NaN' );
6570
}
6671
}
6772
b.toc();
68-
if ( isnan( Y[ i%Y.length ] ) ) {
73+
if ( isnan( z[ i%X.length ] ) ) {
6974
b.fail( 'should not return NaN' );
7075
}
7176
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/lapack/base/dlartv/benchmark/benchmark.ndarray.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,27 @@ function createBenchmark( len ) {
4949
var Y = uniform( len, -10.0, 10.0, options );
5050
var C = uniform( len, -1.0, 1.0, options );
5151
var S = uniform( len, -1.0, 1.0, options );
52-
5352
return benchmark;
5453

54+
/**
55+
* Benchmark function.
56+
*
57+
* @private
58+
* @param {Benchmark} b - benchmark instance
59+
*/
5560
function benchmark( b ) {
61+
var z;
5662
var i;
5763

5864
b.tic();
5965
for ( i = 0; i < b.iterations; i++ ) {
60-
X = uniform( len, -10.0, 10.0, options );
61-
Y = uniform( len, -10.0, 10.0, options );
62-
Y = dlartv( len, X, 1, 0, Y, 1, 0, C, 1, 0, S, 1, 0 );
63-
if ( isnan( Y[ i%Y.length ] ) ) {
66+
z = dlartv( len, X, 1, 0, Y, 1, 0, C, 1, 0, S, 1, 0 );
67+
if ( isnan( z[ i%X.length ] ) ) {
6468
b.fail( 'should not return NaN' );
6569
}
6670
}
6771
b.toc();
68-
if ( isnan( Y[ i%Y.length ] ) ) {
72+
if ( isnan( z[ i%X.length ] ) ) {
6973
b.fail( 'should not return NaN' );
7074
}
7175
b.pass( 'benchmark finished' );
@@ -94,7 +98,7 @@ function main() {
9498
for ( i = min; i <= max; i++ ) {
9599
len = pow( 10, i );
96100
f = createBenchmark( len );
97-
bench( pkg+':ndarray,len='+len, f );
101+
bench( pkg+':ndarray:len='+len, f );
98102
}
99103
}
100104

0 commit comments

Comments
 (0)