From b61c7b73c6e90864b35146fdea95c18d0a34e85d Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad Date: Mon, 5 Jan 2026 15:26:13 +0530 Subject: [PATCH 1/4] 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 bead0d2344a3b658b06ecccb78025b89ce9ca8f5 Mon Sep 17 00:00:00 2001 From: ivishal-g Date: Thu, 15 Jan 2026 01:30:20 +0530 Subject: [PATCH 2/4] bench: refactor to use dynamic memory allocation in stats/strided/dmskrange --- .../dmskrange/benchmark/c/benchmark.length.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c index 7a11e1d2edec..bc696f900d79 100644 --- a/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c @@ -18,6 +18,7 @@ #include "stdlib/stats/strided/dmskrange.h" #include +#include #include #include #include @@ -95,13 +96,15 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - unsigned char mask[ len ]; + unsigned char *mask; double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + mask = (uint8_t *) malloc( len * sizeof( uint8_t ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { mask[ i ] = 1; // missing @@ -124,6 +127,8 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); + free( mask ); return elapsed; } @@ -135,13 +140,15 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - unsigned char mask[ len ]; + unsigned char *mask; double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + mask = (uint8_t *) malloc( len * sizeof( uint8_t ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { mask[ i ] = 1; // missing @@ -164,6 +171,8 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); + free( mask ); return elapsed; } From 5d8b483719189f5d9babeaab4282b7e49212ef87 Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:57:56 +0530 Subject: [PATCH 3/4] Change mask type from unsigned char to uint8_t Signed-off-by: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> --- .../stats/strided/dmskrange/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c index bc696f900d79..22f17ac7eaba 100644 --- a/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c @@ -96,8 +96,8 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - unsigned char *mask; double elapsed; + uint8_t *mask; double *x; double v; double t; From 010ed64b218f568b0b3f4239de141fc920e7ace9 Mon Sep 17 00:00:00 2001 From: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:04:17 +0530 Subject: [PATCH 4/4] Change mask type from unsigned char to uint8_t Signed-off-by: Vishal Gaikwad <154438441+ivishal-g@users.noreply.github.com> --- .../stats/strided/dmskrange/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c index 22f17ac7eaba..f220ff022800 100644 --- a/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dmskrange/benchmark/c/benchmark.length.c @@ -140,8 +140,8 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - unsigned char *mask; double elapsed; + uint8_t *mask; double *x; double v; double t;