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 Person(name) {
this.name = name;
}
Person.prototype.get_name = function() {
return this.name;
};
Person.prototype.set_name = function(name) {
this.name = name;
};
Person.prototype.set_name1 = function(name) {
this.name = name;
};
Person.prototype.set_name2 = function(name) {
this.name = name;
};
Person.prototype.set_name3 = function(name) {
this.name = name;
};
Person.prototype.set_name4 = function(name) {
this.name = name;
};
Person.prototype.set_name5 = function(name) {
this.name = name;
};
var person = function(pname) {
return {
'get_name': function() {
return pname;
},
'set_name': function(name) {
pname = name;
},
'set_name1': function(name) {
pname = name;
},
'set_name2': function(name) {
pname = name;
},
'set_name3': function(name) {
pname = name;
},
'set_name4': function(name) {
pname = name;
},
'set_name5': function(name) {
pname = name;
}
};
};
var _p = new Person('John');
var _c = person('John');
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototype init & 10 writes |
| ready |
Closure init & 10 writes |
| ready |
Closure init & 20 reads |
| ready |
Prototype init & 10 reads |
| ready |
Closure init & 10 reads |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.