Skip to content

Commit 9658180

Browse files
committed
bench: refactor to use string interpolation in complex/float64/base/add
This commit refactors JavaScript benchmarks in complex/float64/base/add to use string interpolation via @stdlib/string/format instead of string concatenation when specifying benchmark names. This improves readability, facilitates easier debugging of malformed benchmark names, and enables future linting of benchmark names. --- 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: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e57055b commit 9658180

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/node_modules/@stdlib/complex/float64/base/add/benchmark/benchmark.assign.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var Float64Array = require( '@stdlib/array/float64' );
27+
var format = require( '@stdlib/string/format' );
2728
var pkg = require( './../package.json' ).name;
2829
var add = require( './../lib' );
2930

@@ -37,7 +38,7 @@ var options = {
3738

3839
// MAIN //
3940

40-
bench( pkg+':assign', function benchmark( b ) {
41+
bench( format( '%s:assign', pkg ), function benchmark( b ) {
4142
var out;
4243
var re;
4344
var im;

lib/node_modules/@stdlib/complex/float64/base/add/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
2828
var real = require( '@stdlib/complex/float64/real' );
2929
var imag = require( '@stdlib/complex/float64/imag' );
3030
var tryRequire = require( '@stdlib/utils/try-require' );
31+
var format = require( '@stdlib/string/format' );
3132
var pkg = require( './../package.json' ).name;
3233

3334

@@ -41,7 +42,7 @@ var opts = {
4142

4243
// MAIN //
4344

44-
bench( pkg+'::native', opts, function benchmark( b ) {
45+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4546
var values;
4647
var out;
4748
var z;

lib/node_modules/@stdlib/complex/float64/base/add/benchmark/benchmark.strided.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var Float64Array = require( '@stdlib/array/float64' );
27+
var format = require( '@stdlib/string/format' );
2728
var pkg = require( './../package.json' ).name;
2829
var add = require( './../lib' );
2930

@@ -37,7 +38,7 @@ var options = {
3738

3839
// MAIN //
3940

40-
bench( pkg+':strided', function benchmark( b ) {
41+
bench( format( '%s:strided', pkg ), function benchmark( b ) {
4142
var out;
4243
var z1;
4344
var z2;

0 commit comments

Comments
 (0)