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 ClosureColor(name) {
// Have no choice but to add these methods to the instance
this.getName = function () {
return name;
};
this.setName = function (n) {
name = n;
};
}
var closureColor = new ClosureColor('green');
function PropertyColor(name) {
this._name = name;
this.getName = function () {
return this._name;
};
this.setName = function (n) {
this._name = n;
};
}
var propertyColor = new PropertyColor('green');
function PrototypeColor(name) {
this._name = name;
}
PrototypeColor.prototype.getName = function () {
return this._name;
};
PrototypeColor.prototype.setName = function (n) {
this._name = n;
};
var prototypeColor = new PrototypeColor('green');
Ready to run.
Test | Ops/sec | |
---|---|---|
Closure |
| ready |
Property |
| ready |
Prototype |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.