From b61c7b73c6e90864b35146fdea95c18d0a34e85d Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad Date: Mon, 5 Jan 2026 15:26:13 +0530 Subject: [PATCH 1/6] bench: refactor to use string interpolation in buffer/from-array-buffer --- 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 --- --- .../buffer/from-arraybuffer/benchmark/benchmark.length.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/buffer/from-arraybuffer/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/buffer/from-arraybuffer/benchmark/benchmark.length.js index ca9820cc557c..dec1bff341ee 100644 --- a/lib/node_modules/@stdlib/buffer/from-arraybuffer/benchmark/benchmark.length.js +++ b/lib/node_modules/@stdlib/buffer/from-arraybuffer/benchmark/benchmark.length.js @@ -25,6 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var isBuffer = require( '@stdlib/assert/is-buffer' ); var ArrayBuffer = require( '@stdlib/array/buffer' ); var Uint8Array = require( '@stdlib/array/uint8' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var arraybuffer2buffer = require( './../lib' ); @@ -95,7 +96,7 @@ function main() { for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); - bench( pkg+':len='+len, f ); + bench( format( '%s:len=%d', pkg, len ), f ); } } From ef6095e664a927d01d50098da137244c126d0c80 Mon Sep 17 00:00:00 2001 From: ivishal-g Date: Thu, 15 Jan 2026 18:08:31 +0530 Subject: [PATCH 2/6] bench: refactor to use dynamic memory allocation in stats/strided/dnanmeanpw --- .../strided/dnanmeanpw/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c index 5350b080a0ee..f45618a16d1c 100644 --- a/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -122,6 +123,7 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -134,11 +136,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -160,6 +163,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } From 43586dcf5430264534e03fad42e0bdfed208dd52 Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> Date: Thu, 15 Jan 2026 18:18:30 +0530 Subject: [PATCH 3/6] Update benchmark.length.c Signed-off-by: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> From 73f448ce2b3012b5bd617a912a674a89eeff8793 Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> Date: Thu, 15 Jan 2026 18:24:19 +0530 Subject: [PATCH 4/6] Update benchmark.length.c Signed-off-by: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> From ea2de67a38d122d4e95073bd7562e26c337f3c84 Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> Date: Thu, 15 Jan 2026 18:32:26 +0530 Subject: [PATCH 5/6] Fix formatting of malloc calls in benchmark.length.c Signed-off-by: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> --- .../stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c index f45618a16d1c..67b9a6b31d0d 100644 --- a/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c @@ -100,8 +100,8 @@ static double benchmark1( int iterations, int len ) { double v; double t; int i; - - x = (double *) malloc( len * sizeof( double ) ); + + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -141,7 +141,7 @@ static double benchmark2( int iterations, int len ) { double t; int i; - x = (double *) malloc( len * sizeof( double ) ); + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN From 895fa17e61437f71772c76792b517912b9b4118a Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> Date: Thu, 15 Jan 2026 18:37:43 +0530 Subject: [PATCH 6/6] Fix formatting issues in benchmark.length.c Signed-off-by: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> --- .../stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c index 67b9a6b31d0d..157402ced357 100644 --- a/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dnanmeanpw/benchmark/c/benchmark.length.c @@ -100,7 +100,7 @@ static double benchmark1( int iterations, int len ) { double v; double t; int i; - + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) {