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 ar = [1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, '55', 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9];
function cc5(a,b,c){
c=a.length;
while(c!=-1&&b!=a[--c]);
//while(c>-1&&b!=a[--c]);
//while(--c!=-1&&b!=a[c]);
return c
}
function cc3(a,b,c,d,e){//value,array,placeholder
for(d=0,c=a.length,e=false;d<c;b!=a[d++]||(e=true,d=c));
return e
}
function cc4(a,b,c,d){//value,array,placeholder
for(
d=0,c=a.length;
d<c;//console.log(d),
b!=a[d++]||(d=c+1)
);
return (a,d,c,d)
}
function cc6(a,b,c){
c=a.length;
//while(c!=-1&&b!=a[--c]);
//while(c>-1&&b!=a[--c]);
while(!(b==a[--c]||c<0));
//while(--c!=-1&&b!=a[c]);
return c
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
indexOf |
| ready |
lastIndexOf |
| ready |
cc5 |
| ready |
cc6 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.