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
<script>
var _v = 10;
var test = {
v: 10,
local_variable: function() {
var v = 10,
n = 100000;
while (--n) v + n;
},
semilocal_variable: (function() {
var v = 10;
return function() {
var n = 100000;
while (--n) v + n;
};
})(),
global_variable: function() {
var n = 100000;
while (--n) _v + n;
},
this_property: function() {
var n = 100000;
while (--n) this.v + n;
},
obj_property: function() {
var obj = {
v: 10
};
var n = 100000;
while (--n) obj.v + n;
},
prototype_property: function() {
function constructor() {};
constructor.prototype.v = 10;
var obj = new constructor();
var n = 100000;
while (--n) obj.v + n;
},
proto_property: function() {
var obj = {};
obj.__proto__ = {
v: 10
};
var n = 100000;
while (--n) obj.v + n;
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
local variable |
| ready |
semi local variable |
| ready |
global variable |
| ready |
this property |
| ready |
obj property |
| ready |
prototype property |
| ready |
__proto__ property |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.