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 ns = [1, 2, 3, 4];
function addAll(dest, src) {
for (var i = 0; i < src.length; i++) {
dest.push(src[i]);
}
return dest;
}
function addAllJ(dest, src) {
for (var i = 0, length = src.length; i < length; i++) {
dest.push(src[i]);
}
return dest;
}
function addAllSet(dest, src) {
for (var i = 0, length = src.length; i < length; i++) {
dest[dest.length] = src[i];
}
return dest;
}
function addAllShift(dest, src) {
var i = src.length;
while (i--) {
dest.push(src.shift);
}
return dest;
}
function addAllWhile(dest, src) {
var i = 0,
s = src.length;
while (s--) {
dest.push(src[i++]);
}
return dest;
}
function addAllOnePush(dest, src) {
Array.prototype.push.apply(dest, src);
return dest;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
mine |
| ready |
caching length |
| ready |
dest[i] = |
| ready |
shift |
| ready |
while |
| ready |
Array.prototype.push |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.