Skip to content
Merged
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
46 changes: 28 additions & 18 deletions lib/node_modules/@stdlib/utils/properties/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,41 @@ var pkg = require( './../package.json' ).name;
var properties = require( './../lib' );


// FUNCTIONS //

/**
* Constructor function for creating benchmark test objects.
*
* @private
* @constructor
* @returns {Foo} Foo instance
*/
function Foo() {
this.a = 'beep';
this.b = 'boop';
this.c = [ 1, 2, 3 ];
this.d = {};
this.e = null;
this.f = randu();
defineProperty( this, 'g', {
'value': 'bar',
'configurable': true,
'writable': true,
'enumerable': false
});
return this;
}

Foo.prototype.h = [ 'foo' ];


// MAIN //

bench( pkg, function benchmark( b ) {
var out;
var obj;
var i;

function Foo() {
this.a = 'beep';
this.b = 'boop';
this.c = [ 1, 2, 3 ];
this.d = {};
this.e = null;
this.f = randu();
defineProperty( this, 'g', {
'value': 'bar',
'configurable': true,
'writable': true,
'enumerable': false
});
return this;
}

Foo.prototype.h = [ 'foo' ];

obj = new Foo();

b.tic();
Expand Down
Loading