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, location) {
this.name = name;
this.location = name + "lives at: " + location;
}
Person.prototype.getinfo = function() {
return this.name + "/" + this.location;
};
Person.prototype.setinfo = function(name, location) {
this.name = name;
this.location = name + "lives at: " + location;
};
var person = function(name, location) {
return {
'getinfo': function() {
return this.name + "/" + this.location;
},
'setinfo': function(n, l) {
name = n;
location = n + "lives at: " + l;
}
};
};
var operson = function(name, location) {
return {name: name, location: location};
};
var getInfo = function(p) {
return p.name + "/" + p.location;
}
var setInfo = function(p, name, location) {
p.name = name;
p.location = name + "lives at: " + location;
}
var _p = new Person('John', 'London');
var _c = person('John', 'London');
var _o = operson('John', 'London');
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototype init |
| ready |
Closure init |
| ready |
Prototype read |
| ready |
Closure read |
| ready |
Prototype write |
| ready |
Closure write |
| ready |
Obj init |
| ready |
Obj read |
| ready |
Obj write |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.