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
var slice = Array.prototype.slice;
function toArray(obj) {
var arr = new Array(obj.length);
for (var i = 0, len = obj.length; i < len; i++) {
arr[i] = obj[i];
}
return arr;
}
var test_arr1 = [];
var test_arr2 = [];
var test_arr3 = [];
for (var i = 0; i < 10; i++) {
test_arr1[i] = i;
}
for (var i = 0; i < 1000; i++) {
test_arr2[i] = i;
}
for (var i = 0; i < 1000000; i++) {
test_arr3[i] = i;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
slice small |
| ready |
toArray small |
| ready |
slice medium |
| ready |
toArray medium |
| ready |
slice large |
| ready |
toArray large |
| ready |
slice small single |
| ready |
toArray small single |
| ready |
slice medium single |
| ready |
toArray medium single |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.