Inheritance performance - object construction

Benchmark created by kogarashisan1 on


Description

Accurate tests of JavaScript class inheritance models.

These tests aim to provide adequate and accurate results by modelind real-life application behaviour and avoiding common pitfalls. For source code and detailed explanation - please visit the repository:

https://github.com/kogarashisan/PerfTests

Tested libraries does not include Prototype or MooTools, cause they are slow. Ext.JS is not included, cause it affects results of other tests.

Preparation HTML

<script src="http://kogarashisan.github.io/PerfTests/export/dependencies-v1.js"></script>
<script src="http://kogarashisan.github.io/PerfTests/export/bundle-v1.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
TypeScript
for (var i = 0; i < 20000; i++) {
    new TypeScriptChildA("a");
    new TypeScriptChildB("b");
}
ready
ClassManager / Browser / Monomorphic
for (var i = 0; i < 20000; i++) {
    new CMBrowserMonoChildA("a");
    new CMBrowserMonoChildB("b");
}
ready
ClassManager / Browser / Polymorphic
for (var i = 0; i < 20000; i++) {
    new CMBrowserPolyChildA("a");
    new CMBrowserPolyChildB("b");
}
ready
ClassManager / Server / Monomorphic / Full
for (var i = 0; i < 20000; i++) {
    new CMServerFullrefMonoChildA("a");
    new CMServerFullrefMonoChildB("b");
}
ready
ClassManager / Server / Monomorphic / Partial
for (var i = 0; i < 20000; i++) {
    new CMServerPartialrefMonoChildA("a");
    new CMServerPartialrefMonoChildB("b");
}
ready
ClassManager / Server / Polymorphic / Partial
for (var i = 0; i < 20000; i++) {
    new CMServerPartialrefPolyChildA("a");
    new CMServerPartialrefPolyChildB("b");
}
ready
DotNetWise inheritWith
for (var i = 0; i < 20000; i++) {
    new DNW_IW_ChildA("a");
    new DNW_IW_ChildB("b");
}
ready
DotNetWise fastClass
for (var i = 0; i < 20000; i++) {
    new DNW_FC_ChildA("a");
    new DNW_FC_ChildB("b");
}
ready
Fiber
for (var i = 0; i < 20000; i++) {
    new FiberChildA("a");
    new FiberChildB("b");
}
ready
John Resig
for (var i = 0; i < 20000; i++) {
    new JRChildA("a");
    new JRChildB("b");
}
ready
Native
for (var i = 0; i < 20000; i++) {
    new NativeChildA("a");
    new NativeChildB("b");
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by kogarashisan1 on
  • Revision 2: published by Billy Tetrud on