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
is it usefull to pre-allocate the array by setting the last value first when assigning some values ?
var Bind2 = function(a, b, c) {
var sum = 0;
for (var i = 0, l = 3; i < l; i++) {
sum += 1;
}
sum += a + b + c;
return sum;
};
var Bind3 = function(a, b, c) {
var sum = 0;
for (var i = 0, l = 3; i < l; i++) {
sum += a;
}
return sum;
};
var Bind = function() {
var sum = 0;
for (var i = 0, l = arguments.length; i < l; i++) {
sum += arguments[i];
}
return sum;
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Bind2 |
| ready |
reverse writing |
| ready |
reverse writing, array allocated with Array constructor |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.