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 elem,
i = 0,
allElements = document.getElementsByTagName("*"),
haystack = [];
// Sizzle Expr.find["TAG"]
while ( (elem = allElements[i++]) ) {
if ( elem.nodeType === 1 ) {
haystack.push( elem );
}
}
</script>
<script>
var result,
lowIndex = haystack[2],
highIndex = haystack[ haystack.length - 2 ],
notFound = document.body.appendChild( document.createElement("noscript") ),
nativeIndexOf = [].indexOf,
simpleIndexOf = function( elems, elem ) {
var i = 0,
len = elems.length;
for ( ; i < len; i++ ) {
if ( elems[i] === elem ) {
return i;
}
}
return -1;
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Not found (simple) |
| ready |
High index (native) |
| ready |
High index (simple) |
| ready |
Not found (native) |
| ready |
Low index (native) |
| ready |
Low index (simple) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.