Skip to content

Commit 39c4de7

Browse files
bench: refactor to use string interpolation in math/base/special
PR-URL: #11390 Reviewed-by: Athan Reines <kgryte@gmail.com> Closes: stdlib-js/metr-issue-tracker#323 Ref: #8647
1 parent a3078e1 commit 39c4de7

100 files changed

Lines changed: 246 additions & 146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var x;
4344
var y;
4445
var i;

lib/node_modules/@stdlib/math/base/special/fast/absf/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var x;
4344
var y;
4445
var i;

lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var x;
4344
var y;
4445
var i;

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-min/benchmark/benchmark.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var randu = require( '@stdlib/random/base/randu' );
2525
var ceil = require( '@stdlib/math/base/special/ceil' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
27+
var format = require( '@stdlib/string/format' );
2728
var pkg = require( './../package.json' ).name;
2829
var ampbm = require( './../lib' );
2930

@@ -54,7 +55,7 @@ bench( pkg, function benchmark( b ) {
5455
b.end();
5556
});
5657

57-
bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=true,ints=false', function benchmark( b ) {
58+
bench( format( '%s:factory:alpha=1.0,beta=0.5,nonnegative=true,ints=false', pkg ), function benchmark( b ) {
5859
var hypot;
5960
var x;
6061
var y;
@@ -81,7 +82,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=true,ints=false', function b
8182
b.end();
8283
});
8384

84-
bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=true,ints=true', function benchmark( b ) {
85+
bench( format( '%s:factory:alpha=1.0,beta=0.5,nonnegative=true,ints=true', pkg ), function benchmark( b ) {
8586
var hypot;
8687
var x;
8788
var y;
@@ -108,7 +109,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=true,ints=true', function be
108109
b.end();
109110
});
110111

111-
bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=false,ints=false', function benchmark( b ) {
112+
bench( format( '%s:factory:alpha=1.0,beta=0.5,nonnegative=false,ints=false', pkg ), function benchmark( b ) {
112113
var hypot;
113114
var x;
114115
var y;
@@ -135,7 +136,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=false,ints=false', function
135136
b.end();
136137
});
137138

138-
bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=false,ints=true', function benchmark( b ) {
139+
bench( format( '%s:factory:alpha=1.0,beta=0.5,nonnegative=false,ints=true', pkg ), function benchmark( b ) {
139140
var hypot;
140141
var x;
141142
var y;
@@ -162,7 +163,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.5,nonnegative=false,ints=true', function b
162163
b.end();
163164
});
164165

165-
bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=true,ints=false', function benchmark( b ) {
166+
bench( format( '%s:factory:alpha=1.0,beta=0.25,nonnegative=true,ints=false', pkg ), function benchmark( b ) {
166167
var hypot;
167168
var x;
168169
var y;
@@ -189,7 +190,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=true,ints=false', function
189190
b.end();
190191
});
191192

192-
bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=true,ints=true', function benchmark( b ) {
193+
bench( format( '%s:factory:alpha=1.0,beta=0.25,nonnegative=true,ints=true', pkg ), function benchmark( b ) {
193194
var hypot;
194195
var x;
195196
var y;
@@ -216,7 +217,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=true,ints=true', function b
216217
b.end();
217218
});
218219

219-
bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=false,ints=false', function benchmark( b ) {
220+
bench( format( '%s:factory:alpha=1.0,beta=0.25,nonnegative=false,ints=false', pkg ), function benchmark( b ) {
220221
var hypot;
221222
var x;
222223
var y;
@@ -243,7 +244,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=false,ints=false', function
243244
b.end();
244245
});
245246

246-
bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=false,ints=true', function benchmark( b ) {
247+
bench( format( '%s:factory:alpha=1.0,beta=0.25,nonnegative=false,ints=true', pkg ), function benchmark( b ) {
247248
var hypot;
248249
var x;
249250
var y;
@@ -270,7 +271,7 @@ bench( pkg+':factory:alpha=1.0,beta=0.25,nonnegative=false,ints=true', function
270271
b.end();
271272
});
272273

273-
bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=true,ints=false', function benchmark( b ) {
274+
bench( format( '%s:factory:alpha=1.0,beta=3/8,nonnegative=true,ints=false', pkg ), function benchmark( b ) {
274275
var hypot;
275276
var x;
276277
var y;
@@ -297,7 +298,7 @@ bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=true,ints=false', function b
297298
b.end();
298299
});
299300

300-
bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=true,ints=true', function benchmark( b ) {
301+
bench( format( '%s:factory:alpha=1.0,beta=3/8,nonnegative=true,ints=true', pkg ), function benchmark( b ) {
301302
var hypot;
302303
var x;
303304
var y;
@@ -324,7 +325,7 @@ bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=true,ints=true', function be
324325
b.end();
325326
});
326327

327-
bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=false,ints=false', function benchmark( b ) {
328+
bench( format( '%s:factory:alpha=1.0,beta=3/8,nonnegative=false,ints=false', pkg ), function benchmark( b ) {
328329
var hypot;
329330
var x;
330331
var y;
@@ -351,7 +352,7 @@ bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=false,ints=false', function
351352
b.end();
352353
});
353354

354-
bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=false,ints=true', function benchmark( b ) {
355+
bench( format( '%s:factory:alpha=1.0,beta=3/8,nonnegative=false,ints=true', pkg ), function benchmark( b ) {
355356
var hypot;
356357
var x;
357358
var y;
@@ -378,7 +379,7 @@ bench( pkg+':factory:alpha=1.0,beta=3/8,nonnegative=false,ints=true', function b
378379
b.end();
379380
});
380381

381-
bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=true,ints=false', function benchmark( b ) {
382+
bench( format( '%s:factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=true,ints=false', pkg ), function benchmark( b ) {
382383
var hypot;
383384
var x;
384385
var y;
@@ -405,7 +406,7 @@ bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=t
405406
b.end();
406407
});
407408

408-
bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=true,ints=true', function benchmark( b ) {
409+
bench( format( '%s:factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=true,ints=true', pkg ), function benchmark( b ) {
409410
var hypot;
410411
var x;
411412
var y;
@@ -432,7 +433,7 @@ bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=t
432433
b.end();
433434
});
434435

435-
bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=false,ints=false', function benchmark( b ) {
436+
bench( format( '%s:factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=false,ints=false', pkg ), function benchmark( b ) {
436437
var hypot;
437438
var x;
438439
var y;
@@ -459,7 +460,7 @@ bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=f
459460
b.end();
460461
});
461462

462-
bench( pkg+':factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=false,ints=true', function benchmark( b ) {
463+
bench( format( '%s:factory:alpha=0.96043387010342,beta=0.397824734759316,nonnegative=false,ints=true', pkg ), function benchmark( b ) {
463464
var hypot;
464465
var x;
465466
var y;

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-min/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var randu = require( '@stdlib/random/base/randu' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var x;
4344
var y;
4445
var h;

lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var x;
4344
var y;
4445
var i;

lib/node_modules/@stdlib/math/base/special/fast/atanh/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var x;
4344
var y;
4445
var i;

lib/node_modules/@stdlib/math/base/special/fast/hypot/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var opts;
4344
var x;
4445
var y;

lib/node_modules/@stdlib/math/base/special/fast/hypotf/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var opts;
4344
var x;
4445
var y;

lib/node_modules/@stdlib/math/base/special/fast/max/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, function benchmark( b ) {
42+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4243
var opts;
4344
var x;
4445
var y;

0 commit comments

Comments
 (0)