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
Measure class performance (http://ejohn.org/blog/simple-javascript-inheritance/)
See http://jsperf.com/mootools-inheritance for mootools version.
<script src="//www.ckoehn.de/files/work/dcs/js/inheritance.js"></script>
<script>
var Point = Class.extend({
init: function() {
this.x = 0;
this.y = 0;
},
setX: function(value) {
this.x = value;
},
setY: function(value) {
this.y = value;
}
});
var Point3D = Point.extend({
init: function() {
this._super();
this.z = 0;
},
setX: function(value) {
this._super(value);
this.z = 3000;
},
setZ: function(value) {
this.z = value;
}
});
var p = new Point(),
p3d = new Point3D();
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Construct Class |
| ready |
Construct Subclass |
| ready |
Call Method on Class |
| ready |
Call overridden Method on Subclass |
| ready |
Call inherited Method on Subclass |
| ready |
Call Method on Subclass |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.