jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src="//cdn.webinfluenza.de/wijcollections-2.1.0.pre.min.js"></script>
Object.prototype.equals = function(iObj) {
if (this.constructor !== iObj.constructor)
return false;
var aMemberCount = 0;
for (var a in this) {
if (!this.hasOwnProperty(a))
continue;
if (typeof this[a] === 'object' && typeof iObj[a] === 'object' ? !this[a].equals(iObj[a]) : this[a] !== iObj[a])
return false;
++aMemberCount;
}
for (var a in iObj)
if (iObj.hasOwnProperty(a))
--aMemberCount;
return aMemberCount ? false : true;
}
var a = {
"duplicateCnt": 0,
"overallCnt": 7,
"key1": {"cnt": 1, "ref": ["baz", "foo"]},
"key2": {"cnt": 1, "ref": {"bar": 34}},
"key3": {"cnt": 1, "ref": 78},
"key4": {"cnt": 1, "ref": 78.91},
"key5": {"cnt": 1, "ref": new Date( 2013, 9, 23 )},
"key7": {"cnt": 1, "ref": "bar"},
"key8": {"cnt": 1, "ref": false}
};
var b = {
"duplicateCnt": 1,
"overallCnt": 7,
"key1": {"cnt": 1, "ref": ["baz", "foo"]},
"key2": {"cnt": 1, "ref": {"bar": 34}},
"key3": {"cnt": 1, "ref": 78},
"key4": {"cnt": 1, "ref": 78.91},
"key5": {"cnt": 1, "ref": new Date( 2013, 9, 23 )},
"key8": {"cnt": 1, "ref": false}
};
var arr = [];
arr.push( a );
arr.push( b );
var search = function( obj ) {
for( var i = 0, iMax = arr.length; i < iMax; i++ ) {
if( arr[i].equals( obj ) ) {
return true;
}
}
return false;
};
var list = new List();
list.add( a );
list.add( b );
Ready to run.
Test | Ops/sec | |
---|---|---|
Normal |
| ready |
wijc |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.