Skip to content
Open
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
Expand Up @@ -24,13 +24,14 @@ var bench = require( '@stdlib/bench' );
var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
var baseEmpty = require( '@stdlib/ndarray/base/empty' );
var empty = require( '@stdlib/ndarray/empty' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var sliceDimensionTo = require( './../lib' );


// MAIN //

bench( pkg+'::1d,base', function benchmark( b ) {
bench( format( '%s::1d,base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand Down Expand Up @@ -60,7 +61,7 @@ bench( pkg+'::1d,base', function benchmark( b ) {
b.end();
});

bench( pkg+'::1d,non-base', function benchmark( b ) {
bench( format( '%s::1d,non-base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand All @@ -69,11 +70,11 @@ bench( pkg+'::1d,non-base', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2 ], { 'dtype': 'float64' } ),
empty( [ 2 ], { 'dtype': 'float32' } ),
empty( [ 2 ], { 'dtype': 'int32' } ),
empty( [ 2 ], { 'dtype': 'complex128' } ),
empty( [ 2 ], { 'dtype': 'generic' } )
empty( [ 2 ], { 'dtype': 'float64' }),
empty( [ 2 ], { 'dtype': 'float32' }),
empty( [ 2 ], { 'dtype': 'int32' }),
empty( [ 2 ], { 'dtype': 'complex128' }),
empty( [ 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -95,7 +96,7 @@ bench( pkg+'::1d,non-base', function benchmark( b ) {
b.end();
});

bench( pkg+'::1d,base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::1d,base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand Down Expand Up @@ -129,7 +130,7 @@ bench( pkg+'::1d,base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::1d,non-base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::1d,non-base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand All @@ -139,11 +140,11 @@ bench( pkg+'::1d,non-base,out-of-bounds', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2 ], { 'dtype': 'float64' } ),
empty( [ 2 ], { 'dtype': 'float32' } ),
empty( [ 2 ], { 'dtype': 'int32' } ),
empty( [ 2 ], { 'dtype': 'complex128' } ),
empty( [ 2 ], { 'dtype': 'generic' } )
empty( [ 2 ], { 'dtype': 'float64' }),
empty( [ 2 ], { 'dtype': 'float32' }),
empty( [ 2 ], { 'dtype': 'int32' }),
empty( [ 2 ], { 'dtype': 'complex128' }),
empty( [ 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -168,7 +169,7 @@ bench( pkg+'::1d,non-base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::2d,base', function benchmark( b ) {
bench( format( '%s::2d,base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand Down Expand Up @@ -198,7 +199,7 @@ bench( pkg+'::2d,base', function benchmark( b ) {
b.end();
});

bench( pkg+'::2d,non-base', function benchmark( b ) {
bench( format( '%s::2d,non-base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand All @@ -207,11 +208,11 @@ bench( pkg+'::2d,non-base', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -233,7 +234,7 @@ bench( pkg+'::2d,non-base', function benchmark( b ) {
b.end();
});

bench( pkg+'::2d,base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::2d,base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand Down Expand Up @@ -267,7 +268,7 @@ bench( pkg+'::2d,base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::2d,non-base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::2d,non-base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand All @@ -277,11 +278,11 @@ bench( pkg+'::2d,non-base,out-of-bounds', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -306,7 +307,7 @@ bench( pkg+'::2d,non-base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::3d,base', function benchmark( b ) {
bench( format( '%s::3d,base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand Down Expand Up @@ -336,7 +337,7 @@ bench( pkg+'::3d,base', function benchmark( b ) {
b.end();
});

bench( pkg+'::3d,non-base', function benchmark( b ) {
bench( format( '%s::3d,non-base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand All @@ -345,11 +346,11 @@ bench( pkg+'::3d,non-base', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -371,7 +372,7 @@ bench( pkg+'::3d,non-base', function benchmark( b ) {
b.end();
});

bench( pkg+'::3d,base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::3d,base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand Down Expand Up @@ -405,7 +406,7 @@ bench( pkg+'::3d,base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::3d,non-base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::3d,non-base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand All @@ -415,11 +416,11 @@ bench( pkg+'::3d,non-base,out-of-bounds', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -444,7 +445,7 @@ bench( pkg+'::3d,non-base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::4d,base', function benchmark( b ) {
bench( format( '%s::4d,base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand Down Expand Up @@ -474,7 +475,7 @@ bench( pkg+'::4d,base', function benchmark( b ) {
b.end();
});

bench( pkg+'::4d,non-base', function benchmark( b ) {
bench( format( '%s::4d,non-base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand All @@ -483,11 +484,11 @@ bench( pkg+'::4d,non-base', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -509,7 +510,7 @@ bench( pkg+'::4d,non-base', function benchmark( b ) {
b.end();
});

bench( pkg+'::4d,base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::4d,base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand Down Expand Up @@ -543,7 +544,7 @@ bench( pkg+'::4d,base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::4d,non-base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::4d,non-base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand All @@ -553,11 +554,11 @@ bench( pkg+'::4d,non-base,out-of-bounds', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -582,7 +583,7 @@ bench( pkg+'::4d,non-base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::5d,base', function benchmark( b ) {
bench( format( '%s::5d,base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand Down Expand Up @@ -612,7 +613,7 @@ bench( pkg+'::5d,base', function benchmark( b ) {
b.end();
});

bench( pkg+'::5d,non-base', function benchmark( b ) {
bench( format( '%s::5d,non-base', pkg ), function benchmark( b ) {
var values;
var v;
var s;
Expand All @@ -621,11 +622,11 @@ bench( pkg+'::5d,non-base', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand All @@ -647,7 +648,7 @@ bench( pkg+'::5d,non-base', function benchmark( b ) {
b.end();
});

bench( pkg+'::5d,base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::5d,base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand Down Expand Up @@ -681,7 +682,7 @@ bench( pkg+'::5d,base,out-of-bounds', function benchmark( b ) {
b.end();
});

bench( pkg+'::5d,non-base,out-of-bounds', function benchmark( b ) {
bench( format( '%s::5d,non-base,out-of-bounds', pkg ), function benchmark( b ) {
var values;
var opts;
var v;
Expand All @@ -691,11 +692,11 @@ bench( pkg+'::5d,non-base,out-of-bounds', function benchmark( b ) {
/* eslint-disable object-curly-newline */

values = [
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' } ),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' } )
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' }),
empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' })
];

/* eslint-enable object-curly-newline */
Expand Down