basePerf.html revision 8089142faf9a180758947150b9d6b0992904335f
<html>
<head>
<title>YUI: Base Perf</title>
</head>
<body class="yui-skin-sam">
<div id="results"></div>
<script>
YUI({base: '/build/'}).use('dump', 'base', 'node', function(Y) {
var res = document.getElementById('results');
var Test = function() {
if (Test.superclass) {
Test.superclass.constructor.apply(this, arguments);
}
};
Test.NAME = 'test';
Test.ATTRS = {
attr1: {
value: "Foo",
setter: function(n) {
return n;
}
},
attr2: {
value: "Bar",
setter: function(n) {
return n;
}
},
attr3: {
value: true
},
attr4: {
value: 3
},
attr5: {
value: 3
},
attr6: {
value: false,
setter: function(lock) {
return lock;
}
},
attr7: {
value: false
},
attr8: {
value: true
},
attr9: {
value: true
},
attr10: {
value: false
},
attr11: {
value: true
},
attr12: {
value: false
},
attr13: {
value: false
},
attr14: {
value: false,
setter: function(val) {
return val;
}
},
attr15: {
value: null,
setter: function(val) {
return false;
}
},
attr16: {
value: ['default'],
getter: function() {
return false;
},
setter: function(g) {
return g;
}
},
attr17: {
value: null,
setter: function(g) {
return g;
}
},
attr18: {
writeOnce: true,
value: null
},
attr19: {
writeOnce: true,
value: null
},
attr20: {
writeOnce: true,
value: null
}
};
foo: function() {}
});
var start, end;
// console.profile("Base");
start = new Date().getTime();
new Test();
new Test();
new Test();
new Test();
new Test();
new Test();
new Test();
new Test();
new Test();
new Test();
end = new Date().getTime();
// console.profileEnd();
res.innerHTML = "Avg Time:" + ((end-start)/10);
var t = new Test();
});
</script>
</body>
</html>