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 Obj() {
this.that = 'that';
}
Obj.prototype.target = function() {
return 'that: ' + this.that + ', args: ' + Array.prototype.slice.call(arguments).join(' ,');
};
function EmApply(t /* target */ , m /* method */ , a /* args */ ) {
var l = a && a.length;
if (!a || !l) {
return m.call(t);
}
switch (l) {
case 1:
return m.call(t, a[0]);
case 2:
return m.call(t, a[0], a[1]);
case 3:
return m.call(t, a[0], a[1], a[2]);
case 4:
return m.call(t, a[0], a[1], a[2], a[3]);
case 5:
return m.call(t, a[0], a[1], a[2], a[3], a[4]);
default:
return m.apply(t, a);
}
}
var myObj = new Obj();
Ready to run.
Test | Ops/sec | |
---|---|---|
Call - 1 Argument |
| ready |
Apply - 1 Argument |
| ready |
Ember Apply |
| ready |
Normal invocation |
| ready |
Call - 4 Arguments |
| ready |
Apply - 4 Arguments |
| ready |
Ember Apply - 4 Arguments |
| ready |
Normal - 4 Arguments |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.