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
function _current(set1, set2) {
set1 = set1 || [];
set2 = set2 || [];
var idx;
var len1 = set1.length;
var len2 = set2.length;
var result = [];
idx = 0;
while (idx < len1) {
result[result.length] = set1[idx];
idx += 1;
}
idx = 0;
while (idx < len2) {
result[result.length] = set2[idx];
idx += 1;
}
return result;
}
function _next(set1, set2) {
set1 = set1 || [];
set2 = set2 || [];
var idx;
var len1 = set1.length;
var len2 = set2.length;
var result = Array(len1 + len2);
idx = 0;
while (idx < len1) {
result[idx] = set1[idx];
idx += 1;
}
idx = 0;
while (idx < len2) {
result[len2 + idx] = set2[idx];
idx += 1;
}
return result;
}
var arr1 = [];
for (i = 0; i < 1000; i++) {
arr1[i] = i;
}
var arr2 = [];
for (i = 2000; i < 3000; i++) {
arr2[i] = i;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Current Ramda |
| ready |
With preset array length |
| ready |
Native |
| ready |
Spread |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.