Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,13 +22,14 @@

var bench = require( '@stdlib/bench' );
var EPS = require( '@stdlib/constants/float64/eps' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var factory = require( './../lib/factory.js' );


// MAIN //

bench( pkg+':factory', function benchmark( b ) {
bench( format( '%s:factory', pkg ), function benchmark( b ) {
var inmapAsync;
var arr;
var len;
Expand All @@ -40,10 +41,10 @@ bench( pkg+':factory', function benchmark( b ) {
clbk( null, v*i );
}
}
arr = new Array( 100 );
len = arr.length;
arr = [];
len = 100;
for ( i = 0; i < len; i++ ) {
arr[ i ] = EPS;
arr.push( EPS );
}
inmapAsync = factory( onItem );

Expand Down
25 changes: 13 additions & 12 deletions lib/node_modules/@stdlib/utils/async/inmap/benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@

var bench = require( '@stdlib/bench' );
var EPS = require( '@stdlib/constants/float64/eps' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var inmapAsync = require( './../lib' );

Expand All @@ -39,10 +40,10 @@ bench( pkg, function benchmark( b ) {
clbk( null, v*i );
}
}
arr = new Array( 100 );
len = arr.length;
arr = [];
len = 100;
for ( i = 0; i < len; i++ ) {
arr[ i ] = EPS;
arr.push( EPS );
}
i = 0;
b.tic();
Expand All @@ -64,7 +65,7 @@ bench( pkg, function benchmark( b ) {
}
});

bench( pkg+':series=true', function benchmark( b ) {
bench( format( '%s:series=true', pkg ), function benchmark( b ) {
var opts;
var arr;
var len;
Expand All @@ -79,10 +80,10 @@ bench( pkg+':series=true', function benchmark( b ) {
opts = {
'series': true
};
arr = new Array( 100 );
len = arr.length;
arr = [];
len = 100;
for ( i = 0; i < len; i++ ) {
arr[ i ] = EPS;
arr.push( EPS );
}
i = 0;
b.tic();
Expand All @@ -104,7 +105,7 @@ bench( pkg+':series=true', function benchmark( b ) {
}
});

bench( pkg+':limit=3', function benchmark( b ) {
bench( format( '%s:limit=3', pkg ), function benchmark( b ) {
var opts;
var arr;
var len;
Expand All @@ -119,10 +120,10 @@ bench( pkg+':limit=3', function benchmark( b ) {
opts = {
'limit': 3
};
arr = new Array( 100 );
len = arr.length;
arr = [];
len = 100;
for ( i = 0; i < len; i++ ) {
arr[ i ] = EPS;
arr.push( EPS );
}
i = 0;
b.tic();
Expand Down