X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ gulp.task('serve/benchmarks_external.dart', pubserve(gulp, gulpPlugins, {
port: 8008
}));

gulp.task('serve.e2e.dart', ['build.js.cjs'], function(neverDone) {
// Note: we are not using build.dart as the dart analyzer takes too long...
watch('modules/**', { ignoreInitial: true }, ['!build/tree.dart', '!build.js.cjs']);
runSequence('build/packages.dart', 'build/pubspec.dart', 'build.dart.material.css', 'serve.dart');
});


// --------------
// doc generation
var Dgeni = require('dgeni');
Expand Down
5 changes: 5 additions & 0 deletions modules/benchmarks/e2e_test/static_tree.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library benchmarks.e2e_test.static_tree_perf;

main() {

}
54 changes: 54 additions & 0 deletions modules/benchmarks/e2e_test/static_tree.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import {runClickBenchmark, verifyNoBrowserErrors} from 'angular2/src/test_lib/perf_util';

describe('ng2 static tree benchmark', function() {

var URL = 'benchmarks/src/static_tree/tree_benchmark.html';

afterEach(verifyNoBrowserErrors);

it('should log the ng stats with viewcache', function(done) {
runClickBenchmark({
url: URL,
buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
id: 'ng2.static.tree.create.viewcache',
params: [{name: 'viewcache', value: 'true'}]
}).then(done, done.fail);
});

it('should log the ng stats without viewcache', function(done) {
runClickBenchmark({
url: URL,
buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
id: 'ng2.static.tree.create.plain',
params: [{name: 'viewcache', value: 'false'}]
}).then(done, done.fail);
});

it('should log the ng stats (update)', function(done) {
runClickBenchmark({
url: URL,
buttons: ['#ng2CreateDom'],
id: 'ng2.static.tree.update',
params: [{name: 'viewcache', value: 'true'}]
}).then(done, done.fail);
});

it('should log the baseline stats', function(done) {
runClickBenchmark({
url: URL,
buttons: ['#baselineDestroyDom', '#baselineCreateDom'],
id: 'baseline.tree.create',
params: [{name: 'depth', value: 9, scale: 'log2'}]
}).then(done, done.fail);
});

it('should log the baseline stats (update)', function(done) {
runClickBenchmark({
url: URL,
buttons: ['#baselineCreateDom'],
id: 'baseline.tree.update',
params: [{name: 'depth', value: 9, scale: 'log2'}]
}).then(done, done.fail);
});

});
3 changes: 3 additions & 0 deletions modules/benchmarks/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<li>
<a href="tree/tree_benchmark.html">Tree benchmark</a>
</li>
<li>
<a href="static_tree/tree_benchmark.html">Static tree benchmark</a>
</li>
<li>
<a href="naive_infinite_scroll/index.html">Naive infinite scroll benchmark</a>
</li>
Expand Down
45 changes: 45 additions & 0 deletions modules/benchmarks/src/static_tree/tree_benchmark.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html>
<body>

<h2>Params</h2>
<form>
<br>
Use Viewcache:
<label>
Yes<input type="radio" name="viewcache" placeholder="use viewcache" value="true" checked="checked">
</label>
<label>
No<input type="radio" name="viewcache" placeholder="use viewcache" value="false">
</label>
<br>
<button>Apply</button>
</form>

<h2>Angular2 static tree benchmark (depth 10)</h2>
<p>
<button id="ng2DestroyDom">destroyDom</button>
<button id="ng2CreateDom">createDom</button>
<button id="ng2UpdateDomProfile">profile updateDom</button>
<button id="ng2CreateDomProfile">profile createDom</button>
</p>

<h2>Baseline static tree benchmark (depth 10)</h2>
<p>
<button id="baselineDestroyDom">destroyDom</button>
<button id="baselineCreateDom">createDom</button>
<button id="baselineUpdateDomProfile">profile updateDom</button>
<button id="baselineCreateDomProfile">profile createDom</button>
</p>

<div>
<app></app>
</div>

<div>
<baseline></baseline>
</div>

$SCRIPTS$
</body>
</html>
Loading
X Tutup