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 toArray = Function.call.bind([].slice);
function fancy() {
return toArray(arguments);
}
function unfancy() {
return Array.prototype.slice.call(arguments, 0);
}
function theHardWay() {
var index = arguments.length;
var res = new Array(index);
while (index--) res[index] = arguments[index];
return res;
}
function lessHardButStillHardWay() {
var index = 0;
var res = [];
while (index < arguments.length) res.push(arguments[index++]);
return res;
}
</script>
if (res[0] !== 1 || res[1] !== 2 || res[2] !== 3 || res.length !== 3) throw new Error();
Ready to run.
Test | Ops/sec | |
---|---|---|
fancy |
| ready |
unfancy |
| ready |
theHardWay |
| ready |
lessHardButStillHardWay |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.