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
A = new Array(1000).fill(undefined).map((_, i) => {
return (i * 2048) % 1000;
});
function containsAnyLoop(i,kal) {
for(var j=0;j<i.length;j++) {
for(var el in kal) {
if(i[j]===kal[el]) {
return true;
}
}
}
return false;
}
function containsAnyLoop2(i,kal) {
for(var j=0;j<i.length;j++) {
for(var k=0;k<kal.length;k++) {
if(i[j]===kal[k]) {
return true;
}
}
}
return false;
}
function containsAnyLoop3(i,kal) {
for(let j=0;j<i.length;j++) {
for(let k=0;k<kal.length;k++) {
if(i[j]===kal[k]) {
return true;
}
}
}
return false;
}
function containsAnyLoopInverse2(i,kal) {
for(var k=0;k<kal.length;k++) {
let ELEM = kal[k];
for(var j=0;j<i.length;j++) {
if(i[j]===ELEM) {
return true;
}
}
}
return false;
}
function containsAnyMix(i,kal) {
for(var j=0;j<i.length;j++) {
if(kal.includes(i[j])) {
return true;
}
}
return false;
}
function containsAnyLoopInverse(i,kal) {
for(var el in kal) {
let ELEM = kal[el];
for(var j=0;j<i.length;j++) {
if(i[j]=== ELEM) {
return true;
}
}
}
return false;
}
function containsAnyFunctional(i,kal) {
return kal.some((elem) => i.includes(elem));
}
A = null;
Ready to run.
Test | Ops/sec | |
---|---|---|
Sanity |
| ready |
Functional |
| ready |
Loop |
| ready |
Loop Inverse |
| ready |
Loop2 |
| ready |
Loop2 Inverse |
| ready |
Mix |
| ready |
Loop3 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.