Skip to content

Commit

Permalink
Adding class creation benchmarks on master branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoglan committed Aug 1, 2008
1 parent bd1d53a commit 3ec3655
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions benchmarks.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -69,6 +69,26 @@


testObjectInstantiation: function() { with(this) { testObjectInstantiation: function() { with(this) {
benchmark(function() { new Bear('Yogi') }, 3000); benchmark(function() { new Bear('Yogi') }, 3000);
}},

testClassCreation: function() { with(this) {
benchmark(function() {
var K = function() {};
K.prototype.method1 = function() {};
K.prototype.method2 = function() {};
}, 100);
benchmark(function() {
var K = Class.create({
method1: function(){},
method2: function(){}
});
}, 100);
benchmark(function() {
var K = new JS.Class({
method1: function(){},
method2: function(){}
});
}, 100);
}} }}
}); });


Expand Down

0 comments on commit 3ec3655

Please sign in to comment.