| Index: test/perf/input/change_1_of_100_test.html
|
| diff --git a/test/perf/input/bindings_10_test.html b/test/perf/input/change_1_of_100_test.html
|
| similarity index 60%
|
| copy from test/perf/input/bindings_10_test.html
|
| copy to test/perf/input/change_1_of_100_test.html
|
| index 6d3f284b46c5655026ead549cceb86eb6355919b..2e966f3c8260c5620866e00883385668c4fa33c7 100644
|
| --- a/test/perf/input/bindings_10_test.html
|
| +++ b/test/perf/input/change_1_of_100_test.html
|
| @@ -7,8 +7,8 @@ BSD-style license that can be found in the LICENSE file.
|
| <html lang="en">
|
| <head>
|
| <!--
|
| - This performance test updates a 10 text binding (depending on the same
|
| - variable) on each iteration.
|
| + This performance test runs has 100 bindings, which get updated on every
|
| + iteration of the benchmark.
|
| -->
|
| <meta charset="utf-8">
|
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
| @@ -16,40 +16,40 @@ BSD-style license that can be found in the LICENSE file.
|
| <script type="application/javascript" src="start_dart.js"></script>
|
| </head>
|
| <body>
|
| - <div>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span id='test'>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - <span>{{x}}</span>
|
| - </div>
|
| + <template iterate="item in items">
|
| + {{item.x}}
|
| + </template>
|
| <script type="application/dart">
|
| import 'dart:html';
|
| import 'package:web_ui/web_ui.dart';
|
| import 'package:unittest/unittest.dart';
|
| import 'perf_common.dart';
|
| +import 'observe_model.dart';
|
|
|
| main() {
|
| useShadowDom = false;
|
| + useObservers = true;
|
| window.setTimeout(() {
|
| var bench = new BindingBenchmark();
|
| perfDone(bench.measure());
|
| }, 0);
|
| }
|
|
|
| -int x = 0;
|
| +final ObservableList<Model> items = (() {
|
| + var items = useObservers ? new ObservableList(10000) : new List(10000);
|
| + for (int i = 0; i < items.length; i++) items[i] = new Model();
|
| + return items;
|
| +})();
|
|
|
| class BindingBenchmark extends BenchmarkBase {
|
| - BindingBenchmark() : super('bind-10');
|
| + BindingBenchmark() : super('change-1-of-100');
|
| run() {
|
| - x++;
|
| - dispatch();
|
| - expect(query('#test').innerHtml, "$x");
|
| + items[42].x++;
|
| + if (useObservers) {
|
| + deliverChangesSync();
|
| + } else {
|
| + dispatch();
|
| + }
|
| }
|
| }
|
| </script>
|
|
|