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
var obj = {},
arr = [],
count = 0;
for (var i = 0; i < 10000; i++) {
arr.push('wowow124.23' + i);
obj['wowow124.23' + i] = 1;
}
function in_array(needle, haystack) {
for (var i = 0, maxi = haystack.length; i < maxi; ++i) {
if (haystack[i] == needle) {
return true;
}
}
return false;
}
function include(needle, haystack) {
return (haystack.indexOf(needle) != -1);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
find in array (123) |
| ready |
find in array (1234) |
| ready |
find in array (9543) |
| ready |
find in obj (123) |
| ready |
find in obj (1234) |
| ready |
find in obj (9543) |
| ready |
indexOf in arr(123) |
| ready |
indexOf in arr(1234) |
| ready |
indexOf in arr(9543) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.