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
Accurate tests of the fastest JavaScript class inheritance models. This test tests instance creation.
These tests aim to provide adequate and accurate results by modeling real-life application behavior and avoiding common performance-testing pitfalls. For source code and detailed explanation of the techniques used to create accurate tests - please visit https://github.com/kogarashisan/PerfTests.
Tested libraries does not include Prototype or MooTools, because they are slow. Ext.JS is not included, because it affects results of other tests.
Related test:
<script src="http://kogarashisan.github.io/PerfTests/export/dependencies-v1.js"></script>
<script src="http://kogarashisan.github.io/PerfTests/export/bundle-v1.js"></script>
<script src="http://www.btetrud.com/files/proto.umd.js"></script>
<script>
var ProtoParent = proto(function() {var cache_buster_0502;
this.init = function(instance_string) {var cache_buster_0503;
this.counter = 0;
this.instance_array = [];
this.instance_string = instance_string;
};
this.method = function (prevent_inline) {var cache_buster_0504;
if (this.counter > 99)
this.counter = this.counter / 2;
else
this.counter++;
if (prevent_inline) {
var i = 0;
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
for (i = 0; i < 1; i++) dummy.method();
}
}
});
var ProtoChildA = proto(ProtoParent, function(superclass) {var cache_buster_0505;
this.init = function(instance_string) {var cache_buster_0506;
this.member_a = 1;
superclass.init.call(this, instance_string);
};
this.method = function() {var cache_buster_0507;
this.member_a = -this.member_a;
superclass.method.call(this, false);
}
});
var ProtoChildB = proto(ProtoParent, function(superclass) {var cache_buster_0508;
this.init = function(instance_string) {var cache_buster_0509;
this.member_b = -1;
superclass.init.call(this, instance_string);
};
this.method = function() {var cache_buster_0510;
this.member_b = -this.member_b;
superclass.method.call(this, false);
}
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
TypeScript |
| ready |
Lava ClassManager / Browser / Monomorphic |
| ready |
Lava ClassManager / Browser / Polymorphic |
| ready |
Lava ClassManager / Server / Monomorphic / Full |
| ready |
Lava ClassManager / Server / Monomorphic / Partial |
| ready |
Lava ClassManager / Server / Polymorphic / Partial |
| ready |
DotNetWise inheritWith |
| ready |
DotNetWise fastClass |
| ready |
Fiber |
| ready |
John Resig's Class |
| ready |
Native |
| ready |
Proto |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.