base initialization
JavaScript performance comparison
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.
| Test | Ops/sec | |
|---|---|---|
initialized |
|
pending… |
w/o initialized |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments