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>
var indexedArray, regArray;
regArray = [{
id: "lkjasdlfkj",
body: "hasdfkasdf"
}, {
id: "81734098ifh",
body: "asdfjklasdjf"
}, {
id: "08huouh00ds",
body: "10384hudhsfjkh"
}, {
id: "asdf0834jn",
body: "asdf89034jkiu"
}, {
id: "asd0832ksajdfij",
body: "asdlkfj8ioj98"
}];
indexedArray = {
lkjasdlfkj: {
body: "hasdfkasdf"
},
"81734098ifh": {
body: "asdfjklasdjf"
},
"08huouh00ds": {
body: "10384hudhsfjkh"
},
"asdf0834jn": {
body: "asdf89034jkiu"
},
"asd0832ksajdfij": {
body: "asdlkfj8ioj98"
}
};
regArray2 = ['hasdfkasdf','1234123','asdfasdf','asdfasdf2','qwerqwer','tyuityu','zxcvzxcv','vbnvbnm','768967896789'];
indexedArray2 = {
'hasdfkasdf':true,
'1234123':true,
'asdfasdf':true,
'asdfasdf2':true,
'qwerqwer':true,
'tyuityu':true,
'zxcvzxcv':true,
'vbnvbnm':true,
'768967896789':true
};
var obj;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
array indexOf lookup |
| ready |
hash table lookup |
| ready |
array indexOf lookup2 |
| ready |
hash look up 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.