Skip to content

Commit cccf137

Browse files
authored
bench: refactor to use string interpolation in array/pool
PR-URL: #9862 Ref: #8674 Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 89e6e3f commit cccf137

16 files changed

+92
-77
lines changed

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.calloc.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ var bench = require( '@stdlib/bench' );
2424
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
2525
var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' );
2626
var isBooleanArray = require( '@stdlib/assert/is-booleanarray' );
27+
var format = require( '@stdlib/string/format' );
2728
var pkg = require( './../package.json' ).name;
2829
var typedarray = require( './../lib' );
2930

3031

3132
// MAIN //
3233

33-
bench( pkg+':calloc', function benchmark( b ) {
34+
bench( format( '%s:calloc', pkg ), function benchmark( b ) {
3435
var arr;
3536
var i;
3637
b.tic();
@@ -48,7 +49,7 @@ bench( pkg+':calloc', function benchmark( b ) {
4849
b.end();
4950
});
5051

51-
bench( pkg+':calloc:dtype=float64', function benchmark( b ) {
52+
bench( format( '%s:calloc:dtype=float64', pkg ), function benchmark( b ) {
5253
var arr;
5354
var i;
5455
b.tic();
@@ -66,7 +67,7 @@ bench( pkg+':calloc:dtype=float64', function benchmark( b ) {
6667
b.end();
6768
});
6869

69-
bench( pkg+':calloc:dtype=float32', function benchmark( b ) {
70+
bench( format( '%s:calloc:dtype=float32', pkg ), function benchmark( b ) {
7071
var arr;
7172
var i;
7273
b.tic();
@@ -84,7 +85,7 @@ bench( pkg+':calloc:dtype=float32', function benchmark( b ) {
8485
b.end();
8586
});
8687

87-
bench( pkg+':calloc:dtype=int32', function benchmark( b ) {
88+
bench( format( '%s:calloc:dtype=int32', pkg ), function benchmark( b ) {
8889
var arr;
8990
var i;
9091
b.tic();
@@ -102,7 +103,7 @@ bench( pkg+':calloc:dtype=int32', function benchmark( b ) {
102103
b.end();
103104
});
104105

105-
bench( pkg+':calloc:dtype=uint32', function benchmark( b ) {
106+
bench( format( '%s:calloc:dtype=uint32', pkg ), function benchmark( b ) {
106107
var arr;
107108
var i;
108109
b.tic();
@@ -120,7 +121,7 @@ bench( pkg+':calloc:dtype=uint32', function benchmark( b ) {
120121
b.end();
121122
});
122123

123-
bench( pkg+':calloc:dtype=int16', function benchmark( b ) {
124+
bench( format( '%s:calloc:dtype=int16', pkg ), function benchmark( b ) {
124125
var arr;
125126
var i;
126127
b.tic();
@@ -138,7 +139,7 @@ bench( pkg+':calloc:dtype=int16', function benchmark( b ) {
138139
b.end();
139140
});
140141

141-
bench( pkg+':calloc:dtype=uint16', function benchmark( b ) {
142+
bench( format( '%s:calloc:dtype=uint16', pkg ), function benchmark( b ) {
142143
var arr;
143144
var i;
144145
b.tic();
@@ -156,7 +157,7 @@ bench( pkg+':calloc:dtype=uint16', function benchmark( b ) {
156157
b.end();
157158
});
158159

159-
bench( pkg+':calloc:dtype=int8', function benchmark( b ) {
160+
bench( format( '%s:calloc:dtype=int8', pkg ), function benchmark( b ) {
160161
var arr;
161162
var i;
162163
b.tic();
@@ -174,7 +175,7 @@ bench( pkg+':calloc:dtype=int8', function benchmark( b ) {
174175
b.end();
175176
});
176177

177-
bench( pkg+':calloc:dtype=uint8', function benchmark( b ) {
178+
bench( format( '%s:calloc:dtype=uint8', pkg ), function benchmark( b ) {
178179
var arr;
179180
var i;
180181
b.tic();
@@ -192,7 +193,7 @@ bench( pkg+':calloc:dtype=uint8', function benchmark( b ) {
192193
b.end();
193194
});
194195

195-
bench( pkg+':calloc:dtype=uint8c', function benchmark( b ) {
196+
bench( format( '%s:calloc:dtype=uint8c', pkg ), function benchmark( b ) {
196197
var arr;
197198
var i;
198199
b.tic();
@@ -210,7 +211,7 @@ bench( pkg+':calloc:dtype=uint8c', function benchmark( b ) {
210211
b.end();
211212
});
212213

213-
bench( pkg+':calloc:dtype=bool', function benchmark( b ) {
214+
bench( format( '%s:calloc:dtype=bool', pkg ), function benchmark( b ) {
214215
var arr;
215216
var i;
216217
b.tic();
@@ -228,7 +229,7 @@ bench( pkg+':calloc:dtype=bool', function benchmark( b ) {
228229
b.end();
229230
});
230231

231-
bench( pkg+':calloc:dtype=complex64', function benchmark( b ) {
232+
bench( format( '%s:calloc:dtype=complex64', pkg ), function benchmark( b ) {
232233
var arr;
233234
var i;
234235
b.tic();
@@ -246,7 +247,7 @@ bench( pkg+':calloc:dtype=complex64', function benchmark( b ) {
246247
b.end();
247248
});
248249

249-
bench( pkg+':calloc:dtype=complex128', function benchmark( b ) {
250+
bench( format( '%s:calloc:dtype=complex128', pkg ), function benchmark( b ) {
250251
var arr;
251252
var i;
252253
b.tic();

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.factory.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222

2323
var bench = require( '@stdlib/bench' );
2424
var isFunction = require( '@stdlib/assert/is-function' );
25+
var format = require( '@stdlib/string/format' );
2526
var pkg = require( './../package.json' ).name;
2627
var typedarray = require( './../lib' );
2728

2829

2930
// MAIN //
3031

31-
bench( pkg+':factory', function benchmark( b ) {
32+
bench( format( '%s:factory', pkg ), function benchmark( b ) {
3233
var f;
3334
var i;
3435
b.tic();
@@ -46,7 +47,7 @@ bench( pkg+':factory', function benchmark( b ) {
4647
b.end();
4748
});
4849

49-
bench( pkg+':factory:highWaterMark', function benchmark( b ) {
50+
bench( format( '%s:factory:highWaterMark', pkg ), function benchmark( b ) {
5051
var opts;
5152
var f;
5253
var i;

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
2525
var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' );
2626
var isBooleanArray = require( '@stdlib/assert/is-booleanarray' );
27+
var format = require( '@stdlib/string/format' );
2728
var pkg = require( './../package.json' ).name;
2829
var typedarray = require( './../lib' );
2930

@@ -48,7 +49,7 @@ bench( pkg, function benchmark( b ) {
4849
b.end();
4950
});
5051

51-
bench( pkg+':dtype=float64', function benchmark( b ) {
52+
bench( format( '%s:dtype=float64', pkg ), function benchmark( b ) {
5253
var arr;
5354
var i;
5455
b.tic();
@@ -66,7 +67,7 @@ bench( pkg+':dtype=float64', function benchmark( b ) {
6667
b.end();
6768
});
6869

69-
bench( pkg+':dtype=float32', function benchmark( b ) {
70+
bench( format( '%s:dtype=float32', pkg ), function benchmark( b ) {
7071
var arr;
7172
var i;
7273
b.tic();
@@ -84,7 +85,7 @@ bench( pkg+':dtype=float32', function benchmark( b ) {
8485
b.end();
8586
});
8687

87-
bench( pkg+':dtype=int32', function benchmark( b ) {
88+
bench( format( '%s:dtype=int32', pkg ), function benchmark( b ) {
8889
var arr;
8990
var i;
9091
b.tic();
@@ -102,7 +103,7 @@ bench( pkg+':dtype=int32', function benchmark( b ) {
102103
b.end();
103104
});
104105

105-
bench( pkg+':dtype=uint32', function benchmark( b ) {
106+
bench( format( '%s:dtype=uint32', pkg ), function benchmark( b ) {
106107
var arr;
107108
var i;
108109
b.tic();
@@ -120,7 +121,7 @@ bench( pkg+':dtype=uint32', function benchmark( b ) {
120121
b.end();
121122
});
122123

123-
bench( pkg+':dtype=int16', function benchmark( b ) {
124+
bench( format( '%s:dtype=int16', pkg ), function benchmark( b ) {
124125
var arr;
125126
var i;
126127
b.tic();
@@ -138,7 +139,7 @@ bench( pkg+':dtype=int16', function benchmark( b ) {
138139
b.end();
139140
});
140141

141-
bench( pkg+':dtype=uint16', function benchmark( b ) {
142+
bench( format( '%s:dtype=uint16', pkg ), function benchmark( b ) {
142143
var arr;
143144
var i;
144145
b.tic();
@@ -156,7 +157,7 @@ bench( pkg+':dtype=uint16', function benchmark( b ) {
156157
b.end();
157158
});
158159

159-
bench( pkg+':dtype=int8', function benchmark( b ) {
160+
bench( format( '%s:dtype=int8', pkg ), function benchmark( b ) {
160161
var arr;
161162
var i;
162163
b.tic();
@@ -174,7 +175,7 @@ bench( pkg+':dtype=int8', function benchmark( b ) {
174175
b.end();
175176
});
176177

177-
bench( pkg+':dtype=uint8', function benchmark( b ) {
178+
bench( format( '%s:dtype=uint8', pkg ), function benchmark( b ) {
178179
var arr;
179180
var i;
180181
b.tic();
@@ -192,7 +193,7 @@ bench( pkg+':dtype=uint8', function benchmark( b ) {
192193
b.end();
193194
});
194195

195-
bench( pkg+':dtype=uint8c', function benchmark( b ) {
196+
bench( format( '%s:dtype=uint8c', pkg ), function benchmark( b ) {
196197
var arr;
197198
var i;
198199
b.tic();
@@ -210,7 +211,7 @@ bench( pkg+':dtype=uint8c', function benchmark( b ) {
210211
b.end();
211212
});
212213

213-
bench( pkg+':dtype=bool', function benchmark( b ) {
214+
bench( format( '%s:dtype=bool', pkg ), function benchmark( b ) {
214215
var arr;
215216
var i;
216217
b.tic();
@@ -228,7 +229,7 @@ bench( pkg+':dtype=bool', function benchmark( b ) {
228229
b.end();
229230
});
230231

231-
bench( pkg+':dtype=complex64', function benchmark( b ) {
232+
bench( format( '%s:dtype=complex64', pkg ), function benchmark( b ) {
232233
var arr;
233234
var i;
234235
b.tic();
@@ -246,7 +247,7 @@ bench( pkg+':dtype=complex64', function benchmark( b ) {
246247
b.end();
247248
});
248249

249-
bench( pkg+':dtype=complex128', function benchmark( b ) {
250+
bench( format( '%s:dtype=complex128', pkg ), function benchmark( b ) {
250251
var arr;
251252
var i;
252253
b.tic();

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.length.bool.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var pow = require( '@stdlib/math/base/special/pow' );
2525
var isBooleanArray = require( '@stdlib/assert/is-booleanarray' );
26+
var format = require( '@stdlib/string/format' );
2627
var pkg = require( './../package.json' ).name;
2728
var typedarray = require( './../lib' );
2829

@@ -89,13 +90,13 @@ function main() {
8990
len = pow( 10, i );
9091

9192
f = createBenchmark( typedarray, len );
92-
bench( pkg+':dtype=bool,len='+len, f );
93+
bench( format( '%s:dtype=bool,len=%d', pkg, len ), f );
9394

9495
f = createBenchmark( typedarray.malloc, len );
95-
bench( pkg+':malloc:dtype=bool,len='+len, f );
96+
bench( format( '%s:malloc:dtype=bool,len=%d', pkg, len ), f );
9697

9798
f = createBenchmark( typedarray.calloc, len );
98-
bench( pkg+':calloc:dtype=bool,len='+len, f );
99+
bench( format( '%s:calloc:dtype=bool,len=%d', pkg, len ), f );
99100
}
100101
}
101102

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.length.complex128.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var pow = require( '@stdlib/math/base/special/pow' );
2525
var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' );
26+
var format = require( '@stdlib/string/format' );
2627
var pkg = require( './../package.json' ).name;
2728
var typedarray = require( './../lib' );
2829

@@ -89,13 +90,12 @@ function main() {
8990
len = pow( 10, i );
9091

9192
f = createBenchmark( typedarray, len );
92-
bench( pkg+':dtype=complex128,len='+len, f );
93-
93+
bench( format( '%s:dtype=complex128,len=%d', pkg, len ), f );
9494
f = createBenchmark( typedarray.malloc, len );
95-
bench( pkg+':malloc:dtype=complex128,len='+len, f );
95+
bench( format( '%s:malloc:dtype=complex128,len=%d', pkg, len ), f );
9696

9797
f = createBenchmark( typedarray.calloc, len );
98-
bench( pkg+':calloc:dtype=complex128,len='+len, f );
98+
bench( format( '%s:calloc:dtype=complex128,len=%d', pkg, len ), f );
9999
}
100100
}
101101

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.length.complex64.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var pow = require( '@stdlib/math/base/special/pow' );
2525
var isComplexTypedArray = require( '@stdlib/assert/is-complex-typed-array' );
26+
var format = require( '@stdlib/string/format' );
2627
var pkg = require( './../package.json' ).name;
2728
var typedarray = require( './../lib' );
2829

@@ -89,13 +90,13 @@ function main() {
8990
len = pow( 10, i );
9091

9192
f = createBenchmark( typedarray, len );
92-
bench( pkg+':dtype=complex64,len='+len, f );
93+
bench( format( '%s:dtype=complex64,len=%d', pkg, len ), f );
9394

9495
f = createBenchmark( typedarray.malloc, len );
95-
bench( pkg+':malloc:dtype=complex64,len='+len, f );
96+
bench( format( '%s:malloc:dtype=complex64,len=%d', pkg, len ), f );
9697

9798
f = createBenchmark( typedarray.calloc, len );
98-
bench( pkg+':calloc:dtype=complex64,len='+len, f );
99+
bench( format( '%s:calloc:dtype=complex64,len=%d', pkg, len ), f );
99100
}
100101
}
101102

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.length.float32.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var pow = require( '@stdlib/math/base/special/pow' );
2525
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
26+
var format = require( '@stdlib/string/format' );
2627
var pkg = require( './../package.json' ).name;
2728
var typedarray = require( './../lib' );
2829

@@ -89,13 +90,13 @@ function main() {
8990
len = pow( 10, i );
9091

9192
f = createBenchmark( typedarray, len );
92-
bench( pkg+':dtype=float32,len='+len, f );
93+
bench( format( '%s:dtype=float32,len=%d', pkg, len ), f );
9394

9495
f = createBenchmark( typedarray.malloc, len );
95-
bench( pkg+':malloc:dtype=float32,len='+len, f );
96+
bench( format( '%s:malloc:dtype=float32,len=%d', pkg, len ), f );
9697

9798
f = createBenchmark( typedarray.calloc, len );
98-
bench( pkg+':calloc:dtype=float32,len='+len, f );
99+
bench( format( '%s:calloc:dtype=float32,len=%d', pkg, len ), f );
99100
}
100101
}
101102

lib/node_modules/@stdlib/array/pool/benchmark/benchmark.length.float64.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var pow = require( '@stdlib/math/base/special/pow' );
2525
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
26+
var format = require( '@stdlib/string/format' );
2627
var pkg = require( './../package.json' ).name;
2728
var typedarray = require( './../lib' );
2829

@@ -89,13 +90,13 @@ function main() {
8990
len = pow( 10, i );
9091

9192
f = createBenchmark( typedarray, len );
92-
bench( pkg+':dtype=float64,len='+len, f );
93+
bench( format( '%s:dtype=float64,len=%d', pkg, len ), f );
9394

9495
f = createBenchmark( typedarray.malloc, len );
95-
bench( pkg+':malloc:dtype=float64,len='+len, f );
96+
bench( format( '%s:malloc:dtype=float64,len=%d', pkg, len ), f );
9697

9798
f = createBenchmark( typedarray.calloc, len );
98-
bench( pkg+':calloc:dtype=float64,len='+len, f );
99+
bench( format( '%s:calloc:dtype=float64,len=%d', pkg, len ), f );
99100
}
100101
}
101102

0 commit comments

Comments
 (0)