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
const testObj = JSON.parse('{"_id":"66b10cb7ec09b2164282378d","index":0,"guid":"185374df-0080-4ea4-b5d6-329e4d0cbf94","isActive":true,"balance":"$1,020.21","picture":"http://placehold.it/32x32","age":23,"eyeColor":"blue","name":"Ester Lara","gender":"female","company":"TERSANKI","email":"esterlara@tersanki.com","phone":"+1 (849) 443-3140","address":"780 Pioneer Street, Torboy, Marshall Islands, 5653","about":"Cillum nostrud incididunt aliqua nostrud quis eiusmod cillum in consectetur cillum tempor. Amet culpa pariatur ea fugiat fugiat nisi aliquip irure. Ut tempor amet et aliqua culpa tempor duis do. Cillum id magna qui aute eu ullamco deserunt fugiat minim qui consequat. Enim do laborum est Lorem aliquip Lorem incididunt nisi adipisicing sit aliqua laborum pariatur. Consequat nulla ea irure fugiat excepteur magna. Consequat reprehenderit ipsum ut nostrud voluptate et.","registered":"2023-06-09T10:28:24 -02:00","latitude":-87.39136,"longitude":123.17636,"tags":["proident","in","quis","qui","exercitation","commodo","reprehenderit"],"friends":[{"id":0,"name":"Tonia Benton"},{"id":1,"name":"Garcia Ortiz"},{"id":2,"name":"Fowler Bryant"}],"greeting":"Hello, Ester Lara! You have 5 unread messages.","favoriteFruit":"apple"}')
const compareObj = JSON.parse(JSON.stringify(testObj))
function deepCompare (json1, json2) {
if (typeof json1 !== typeof json2) {
return false;
}
if (typeof json1 === 'object') {
if (json1 === null || json2 === null) {
return json1 === json2;
}
if (json1.length !== json2.length) {
return false;
}
for (let key in json1) {
if (!deepCompare(json1[key], json2[key])) {
return false;
}
}
return true;
}
return json1 === json2;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
stringify compare |
| ready |
deep compare |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.