Skip to content

Commit 0b42f76

Browse files
authored
bench: refactor to use string interpolation in blas/tools/swap-factory
PR-URL: #10832 Ref: #8647 Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 748ab37 commit 0b42f76

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/node_modules/@stdlib/blas/tools/swap-factory/benchmark/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var pow = require( '@stdlib/math/base/special/pow' );
2626
var uniform = require( '@stdlib/random/array/uniform' );
2727
var array = require( '@stdlib/ndarray/array' );
2828
var dswap = require( '@stdlib/blas/base/dswap' ).ndarray;
29+
var format = require( '@stdlib/string/format' );
2930
var pkg = require( './../package.json' ).name;
3031
var factory = require( './../lib' );
3132

@@ -99,7 +100,7 @@ function main() {
99100
for ( i = min; i <= max; i++ ) {
100101
len = pow( 10, i );
101102
f = createBenchmark( len );
102-
bench( pkg+':len='+len, f );
103+
bench( format( '%s:len=%d', pkg, len ), f );
103104
}
104105
}
105106

lib/node_modules/@stdlib/blas/tools/swap-factory/benchmark/benchmark.stacks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var uniform = require( '@stdlib/random/array/uniform' );
2727
var numel = require( '@stdlib/ndarray/base/numel' );
2828
var array = require( '@stdlib/ndarray/array' );
2929
var dswap = require( '@stdlib/blas/base/dswap' ).ndarray;
30+
var format = require( '@stdlib/string/format' );
3031
var pkg = require( './../package.json' ).name;
3132
var factory = require( './../lib' );
3233

@@ -113,11 +114,11 @@ function main() {
113114

114115
shape = [ 2, N/2 ];
115116
f = createBenchmark( shape );
116-
bench( pkg+'::stacks:size='+N+',ndims='+shape.length+',shape=('+shape.join( ',' )+')', f );
117+
bench( format( '%s::stacks:size=%d,ndims=%d,shape=(%s)', pkg, N, shape.length, shape.join( ',' ) ), f );
117118

118119
shape = [ N/2, 2 ];
119120
f = createBenchmark( shape );
120-
bench( pkg+'::stacks:size='+N+',ndims='+shape.length+',shape=('+shape.join( ',' )+')', f );
121+
bench( format( '%s::stacks:size=%d,ndims=%d,shape=(%s)', pkg, N, shape.length, shape.join( ',' ) ), f );
121122
}
122123
}
123124

0 commit comments

Comments
 (0)