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
function deepCopy(o) {
var copy = o,k;
if (o && typeof o === 'object') {
copy = Object.prototype.toString.call(o) === '[object Array]' ? [] : {};
for (k in o) {
copy[k] = deepCopy(o[k]);
}
}
return copy;
}
var uc = {
"left": 0,
"top": 0,
"width": 400,
"height": 400,
"borderLeft": 0,
"borderTop": 0,
"borderWidth": 400,
"borderHeight": 400,
"contentLeft": 0,
"contentTop": 0,
"contentWidth": 400,
"contentHeight": 400,
"paddingLeft": 0,
"paddingTop": 0,
"paddingWidth": 400,
"paddingHeight": 400,
"items": [
{
"left": 25,
"top": 100,
"width": 100,
"height": 100,
"borderLeft": 25,
"borderTop": 100,
"borderWidth": 100,
"borderHeight": 100,
"contentLeft": 25,
"contentTop": 100,
"contentWidth": 100,
"contentHeight": 100,
"paddingLeft": 25,
"paddingTop": 100,
"paddingWidth": 100,
"paddingHeight": 100
},
{
"left": 125,
"top": 150,
"width": 50,
"height": 50,
"borderLeft": 125,
"borderTop": 150,
"borderWidth": 50,
"borderHeight": 50,
"contentLeft": 125,
"contentTop": 150,
"contentWidth": 50,
"contentHeight": 50,
"paddingLeft": 125,
"paddingTop": 150,
"paddingWidth": 50,
"paddingHeight": 50
},
{
"left": 175,
"top": 0,
"width": 200,
"height": 200,
"borderLeft": 175,
"borderTop": 0,
"borderWidth": 200,
"borderHeight": 200,
"contentLeft": 175,
"contentTop": 0,
"contentWidth": 200,
"contentHeight": 200,
"paddingLeft": 175,
"paddingTop": 0,
"paddingWidth": 200,
"paddingHeight": 200
},
{
"left": 25,
"top": 200,
"width": 200,
"height": 200,
"borderLeft": 25,
"borderTop": 200,
"borderWidth": 200,
"borderHeight": 200,
"contentLeft": 25,
"contentTop": 200,
"contentWidth": 200,
"contentHeight": 200,
"paddingLeft": 25,
"paddingTop": 200,
"paddingWidth": 200,
"paddingHeight": 200
},
{
"left": 225,
"top": 350,
"width": 50,
"height": 50,
"borderLeft": 225,
"borderTop": 350,
"borderWidth": 50,
"borderHeight": 50,
"contentLeft": 225,
"contentTop": 350,
"contentWidth": 50,
"contentHeight": 50,
"paddingLeft": 225,
"paddingTop": 350,
"paddingWidth": 50,
"paddingHeight": 50
},
{
"left": 275,
"top": 300,
"width": 100,
"height": 100,
"borderLeft": 275,
"borderTop": 300,
"borderWidth": 100,
"borderHeight": 100,
"contentLeft": 275,
"contentTop": 300,
"contentWidth": 100,
"contentHeight": 100,
"paddingLeft": 275,
"paddingTop": 300,
"paddingWidth": 100,
"paddingHeight": 100
}
]
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Deep Copy |
| ready |
JSON Stringify / JSON Parse |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.