base initialization

JavaScript performance comparison

Test case created by Juan

Preparation code

<script src="http://yui.yahooapis.com/combo?3.8.1/build/yui-base/yui-base-min.js&3.8.1/build/oop/oop-min.js&3.8.1/build/attribute-core/attribute-core-min.js&3.8.1/build/base-core/base-core-min.js"></script>
<script type="text/javascript">
  var Y1 = YUI().use('base-core');
  var Y2 = YUI().use('base-core');
 
  function Foo1() {
    Foo1.superclass.constructor.apply(this, arguments);
  }
  Y1.extend(Foo1, Y1.BaseCore);
 
  Y2.BaseCore.prototype._baseInit = function (cfg) {
    this._initHierarchy(cfg);
  };
 
  function Foo2() {
    Foo2.superclass.constructor.apply(this, arguments);
  }
  Y2.extend(Foo2, Y2.BaseCore);
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
initialized
var foo = new Foo1();
pending…
w/o initialized
var foo = new Foo2();
pending…

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

Compare results of other browsers

0 comments

Add a comment