2015-04-26 14:35:25 -04:00
|
|
|
var perfUtil = require('angular2/src/test_lib/perf_util');
|
|
|
|
|
|
|
|
describe('ng2 cost benchmark', function () {
|
|
|
|
|
|
|
|
var URL = 'benchmarks/src/costs/index.html';
|
2015-04-26 15:15:42 -04:00
|
|
|
|
|
|
|
// Number of components to create in a single iteration
|
2015-04-26 14:35:25 -04:00
|
|
|
var benchmarkSize = 200;
|
|
|
|
|
|
|
|
afterEach(perfUtil.verifyNoBrowserErrors);
|
|
|
|
|
|
|
|
it('should log stats for baseline (plain components)', function(done) {
|
|
|
|
perfUtil.runClickBenchmark({
|
|
|
|
url: URL,
|
|
|
|
buttons: ['#reset', '#createPlainComponents'],
|
|
|
|
id: 'ng2.costs.baseline',
|
|
|
|
params: [{
|
2015-04-26 15:15:42 -04:00
|
|
|
name: 'size', value: benchmarkSize, scale: 'linear'
|
2015-04-26 14:35:25 -04:00
|
|
|
}]
|
|
|
|
}).then(done, done.fail);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should log stats for components with decorators', function(done) {
|
|
|
|
perfUtil.runClickBenchmark({
|
|
|
|
url: URL,
|
2015-04-30 16:38:40 -04:00
|
|
|
buttons: ['#reset', '#createComponentsWithDirectives'],
|
2015-04-26 14:35:25 -04:00
|
|
|
id: 'ng2.costs.decorators',
|
|
|
|
params: [{
|
2015-04-26 15:15:42 -04:00
|
|
|
name: 'size', value: benchmarkSize, scale: 'linear'
|
|
|
|
}]
|
|
|
|
}).then(done, done.fail);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should log stats for dynamic components', function(done) {
|
|
|
|
perfUtil.runClickBenchmark({
|
|
|
|
url: URL,
|
|
|
|
buttons: ['#reset', '#createDynamicComponents'],
|
|
|
|
id: 'ng2.costs.dynamic',
|
|
|
|
params: [{
|
|
|
|
name: 'size', value: benchmarkSize, scale: 'linear'
|
2015-04-26 14:35:25 -04:00
|
|
|
}]
|
|
|
|
}).then(done, done.fail);
|
|
|
|
});
|
|
|
|
});
|