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 ProtoPerson(name) {
this.name = name;
}
ProtoPerson.prototype.get_name = function() {
return this.name;
};
ProtoPerson.prototype.set_name = function(name) {
this.name = name;
};
var ObjPerson = function(pname) {
return {
'get_name': function() {
return pname;
},
'set_name': function(name) {
pname = name;
}
};
};
var ClosPerson = function(name) {
this.set_name = function(n) {
name=n;
};
this.get_name = function() {
return name;
};
}
var _p = new ProtoPerson('John');
var _o = ObjPerson('John');
var _c = new ClosPerson('John');
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototype get |
| ready |
Closure get |
| ready |
Prototype set |
| ready |
Closure set |
| ready |
Plain Object get |
| ready |
Plain Object set |
| ready |
new Prototype |
| ready |
new Closure |
| ready |
new plain Object |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.