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 arr = [4, 6, 3, 5, 7];
var item = 56;
function isMember(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === item) {
return true;
}
}
return false;
}
function isMemberRecursive(arr, item) {
if (arr.length == 0) {
return false;
}
else {
car = arr[0]; cdr = arr.slice(1);
if (car == item) {
return true;
}
else {
return isMemberRecursive(cdr, item);
}
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Non-recursive |
| ready |
Recursive |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.