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
<button id="testbutton1">
Text
</button>
<button id="testbutton2">
Text
</button>
<button id="testbutton3">
Text
</button>
<button id="testbutton4">
Text
</button>
<button id="testbutton5">
Text
</button>
<script>
var test = {
// n: 1,
a: document.getElementById('testbutton1'),
b: document.getElementById('testbutton2'),
c: document.getElementById('testbutton3'),
d: document.getElementById('testbutton4'),
e: document.getElementById('testbutton5'),
init: function() {
var that = this;
this.Call = function(m) {
var o = function(e) {
m.call(that, e);
};
return o;
};
this.Apply = function(m) {
var o = function(e) {
m.apply(that, e);
};
return o;
};
this.Call2 = function(m) {
var o = function(e) {
that[m].call(that, e);
};
return o;
};
this.Apply2 = function(m) {
var o = function(e) {
that[m].apply(that, e);
};
return o;
};
this.a.addEventListener('click', this.Call(this.evt), false);
this.b.addEventListener('click', this.Apply(this.evt), false);
this.c.addEventListener('click', this.Call2('evt'), false);
this.d.addEventListener('click', this.Apply2('evt'), false);
this.e.addEventListener('click', this.evt.bind(this), false);
},
evt: function(evt) {
// console.log(this.n);
return;
}
};
test.init();
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
call |
| ready |
apply |
| ready |
call 2 |
| ready |
apply 2 |
| ready |
bind |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.