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 res = []
var slice = [].slice;
function f1(){
for(var i = 0, l = arguments.length; i < l; i++){
res.push(arguments[i])
}
}
function f2(){
var args = arguments
for(var i = 0, l = args.length; i < l; i++){
res.push(args[i])
}
}
function f3(){
var len = arguments.length;
res = new Array(len);
for (var i = 0; i < len; i++)
res[i] = arguments[i];
}
function f4(){
res = Array.prototype.slice.call(arguments);
}
function f5_helper(){
res = arguments;
}
function f5(){
f5_helper.apply(null, arguments);
}
function f6() {
res = 1 <= arguments.length ? slice.call(arguments, 0) : [];
};
res = []
Ready to run.
Test | Ops/sec | |
---|---|---|
arguments |
| ready |
args |
| ready |
copy with preallocation |
| ready |
slice |
| ready |
apply |
| ready |
coffeescript |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.