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
Same stuff done in version 1 except no function calls are involved.
http://jsperf.com/in-operator
<script>
var
// simple shim that *should* fail in old browsers
// if getters/setters are not supported
defineProperty = Object.defineProperty || function (o, k, v) {
o.__defineGetter__(k, v.get);
o.__defineSetter__(k, v.set);
return o;
},
descriptor = {
get: function () {
return this._prop || {}; // let's say the default
},
set: function (_prop) {
// here something more meaningful ...
this._prop = _prop;
}
},
descriptorSet = {
get: function () {
return this._prop;
},
set: function (_prop) {
// here something more meaningful ...
this._prop = _prop;
}
},
object = {},
globalResult
;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
in operator set |
| ready |
in operator |
| ready |
in operator + magic set |
| ready |
in operator + magic |
| ready |
common pattern set |
| ready |
common pattern |
| ready |
common pattern + magic set |
| ready |
common pattern + magic |
| ready |
better pattern set |
| ready |
better pattern |
| ready |
better pattern + magic set |
| ready |
better pattern + magic |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.