From 0c073c521a472ed357abdb0ad098829de22126e8 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Sun, 19 Apr 2026 14:05:33 -0400 Subject: [PATCH] bench: refactor to use string interpolation in `@stdlib/console` --- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/console/log-each-map/benchmark/benchmark.js | 7 ++++--- .../console/log-each-map/benchmark/benchmark.length.js | 3 ++- .../@stdlib/console/log-each/benchmark/benchmark.js | 5 +++-- .../@stdlib/console/log-each/benchmark/benchmark.length.js | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.js b/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.js index 528498ba1272..729b4f1dd4df 100644 --- a/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.js @@ -22,6 +22,7 @@ var proxyquire = require( 'proxyquire' ); var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -41,7 +42,7 @@ function clbk( x ) { // MAIN // -bench( pkg+'::no_collections', function benchmark( b ) { +bench( format( '%s::no_collections', pkg ), function benchmark( b ) { var logEachMap; var i; @@ -64,7 +65,7 @@ bench( pkg+'::no_collections', function benchmark( b ) { } }); -bench( pkg+'::collections:len=1', function benchmark( b ) { +bench( format( '%s::collections:len=1', pkg ), function benchmark( b ) { var logEachMap; var i; @@ -87,7 +88,7 @@ bench( pkg+'::collections:len=1', function benchmark( b ) { } }); -bench( pkg+'::collections:len=2', function benchmark( b ) { +bench( format( '%s::collections:len=2', pkg ), function benchmark( b ) { var logEachMap; var i; diff --git a/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.length.js index b78b6a457ae1..a20696425f79 100644 --- a/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/console/log-each-map/benchmark/benchmark.length.js @@ -24,6 +24,7 @@ var proxyquire = require( 'proxyquire' ); var bench = require( '@stdlib/bench' ); var zeros = require( '@stdlib/array/zeros' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -102,7 +103,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::collections:len='+len, f ); + bench( format( '%s::collections:len=%d', pkg, len ), f ); } } diff --git a/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.js b/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.js index 0e287418f581..8ae645662bc4 100644 --- a/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.js @@ -22,12 +22,13 @@ var proxyquire = require( 'proxyquire' ); var bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; // MAIN // -bench( pkg+'::no_collections', function benchmark( b ) { +bench( format( '%s::no_collections', pkg ), function benchmark( b ) { var logEach; var i; @@ -50,7 +51,7 @@ bench( pkg+'::no_collections', function benchmark( b ) { } }); -bench( pkg+'::collections:len=1', function benchmark( b ) { +bench( format( '%s::collections:len=1', pkg ), function benchmark( b ) { var logEach; var i; diff --git a/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.length.js index 9e1f67336e16..a3396a042f88 100644 --- a/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/console/log-each/benchmark/benchmark.length.js @@ -24,6 +24,7 @@ var proxyquire = require( 'proxyquire' ); var bench = require( '@stdlib/bench' ); var zeros = require( '@stdlib/array/zeros' ); var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; @@ -91,7 +92,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+'::collections:len='+len, f ); + bench( format( '%s::collections:len=%d', pkg, len ), f ); } }