Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated performance tests to latest spec
- Loading branch information
Showing
3 changed files
with
120 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,41 @@ | ||
YUI().use('app', 'benchmark', function (Y) { | ||
|
||
var suite = new Benchmark.Suite(); | ||
Y.Benchmark.addTest(suite); | ||
YUI.add('app-benchmark', function (Y, NAME) { | ||
|
||
var suite = Y.Benchmark.suite; | ||
|
||
// -- Y.Model ------------------------------------------------------------------ | ||
suite.add('Y.Model: Instantiate a bare model', function () { | ||
var model = new Y.Model(); | ||
suite.add({ | ||
Y: Y, | ||
name: 'Y.Model: Instantiate a bare model', | ||
fn: function () { | ||
var model = new Y.Model(); | ||
} | ||
}); | ||
|
||
suite.add('Y.Model: Subclass and instantiate a bare model', function () { | ||
var MyModel = Y.Base.create('myModel', Y.Model, []), | ||
model = new MyModel(); | ||
suite.add({ | ||
Y: Y, | ||
name: 'Y.Model: Subclass and instantiate a bare model', | ||
fn: function () { | ||
var MyModel = Y.Base.create('myModel', Y.Model, []), | ||
model = new MyModel(); | ||
} | ||
}); | ||
|
||
// -- Y.View ------------------------------------------------------------------- | ||
suite.add('Y.View: Instantiate a bare view', function () { | ||
var view = new Y.View(); | ||
suite.add({ | ||
Y: Y, | ||
name: 'Y.View: Instantiate a bare view', | ||
fn: function () { | ||
var view = new Y.View(); | ||
} | ||
}); | ||
|
||
suite.add('Y.View: Instantiate and subclass a bare view', function () { | ||
var MyView = Y.Base.create('myView', Y.View, []), | ||
view = new MyView(); | ||
suite.add({ | ||
Y: Y, | ||
name: 'Y.View: Instantiate and subclass a bare view', | ||
fn: function () { | ||
var MyView = Y.Base.create('myView', Y.View, []), | ||
view = new MyView(); | ||
} | ||
}); | ||
|
||
suite.run(true); | ||
|
||
}); | ||
|
||
}, '@VERSION@', {requires: ['app']}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
YUI().use('scrollview-base', 'benchmark', function (Y) { | ||
YUI.add('scrollview-benchmark', function (Y, NAME) { | ||
|
||
var container = document.createElement('div'), | ||
bench, | ||
var suite = Y.Benchmark.suite, | ||
container, | ||
scrollview; | ||
|
||
|
||
container = document.createElement('div') | ||
container.id = "container"; | ||
document.body.appendChild(container); | ||
|
||
var suite = new Benchmark.Suite(); | ||
|
||
Y.Benchmark.addTest(suite); | ||
|
||
suite.add("Create and Destroy", function () { | ||
scrollview = new Y.ScrollView({ | ||
render: container | ||
}); | ||
scrollview.destroy(); | ||
suite.add({ | ||
Y: Y, | ||
name: 'ScrollView: Create', | ||
fn: function () { | ||
scrollview = new Y.ScrollView({ | ||
render: container | ||
}); | ||
} | ||
}); | ||
|
||
suite.run(); | ||
suite.add({ | ||
Y: Y, | ||
name: 'ScrollView: Create & Destroy', | ||
fn: function () { | ||
scrollview = new Y.ScrollView({ | ||
render: container | ||
}); | ||
scrollview.destroy(); | ||
} | ||
}); | ||
|
||
}); | ||
}, '@VERSION@', {requires: ['scrollview-base']}); |