| Index: test/perf/input/loop_1_100_test.html
|
| diff --git a/test/perf/input/loop_1_100_test.html b/test/perf/input/loop_1_100_test.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c32c4c81896ce70deff2f591232db4826fb8d8f2
|
| --- /dev/null
|
| +++ b/test/perf/input/loop_1_100_test.html
|
| @@ -0,0 +1,67 @@
|
| +<!DOCTYPE html>
|
| +<!--
|
| +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +for details. All rights reserved. Use of this source code is governed by a
|
| +BSD-style license that can be found in the LICENSE file.
|
| +-->
|
| +<html lang="en">
|
| +<head>
|
| +<!--
|
| + This performance test mutates a list of 100 elements used in a single loop.
|
| + -->
|
| + <meta charset="utf-8">
|
| + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
| + <script type="application/javascript" src="testing.js"></script>
|
| + <script type="application/javascript" src="start_dart.js"></script>
|
| +</head>
|
| +<body>
|
| + <template iterate="x in list">
|
| + <span>{{x}}</span>
|
| + </template>
|
| + <script type="application/dart">
|
| +import 'dart:html';
|
| +import 'package:web_ui/web_ui.dart';
|
| +import 'package:unittest/unittest.dart';
|
| +import 'perf_common.dart';
|
| +
|
| +main() {
|
| + useShadowDom = false;
|
| + window.setTimeout(() {
|
| + var bench = new LoopBenchmark();
|
| + perfDone(bench.measure());
|
| + }, 0);
|
| +}
|
| +
|
| +const DEFAULT_LIST = const [
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| + 0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
|
| +];
|
| +
|
| +List list = [];
|
| +
|
| +class LoopBenchmark extends BenchmarkBase {
|
| + LoopBenchmark() : super('loop-1-100');
|
| + int pos = 0;
|
| + setup() {
|
| + list.clear();
|
| + list.addAll(DEFAULT_LIST);
|
| + pos = 0;
|
| + }
|
| +
|
| + run() {
|
| + list[pos] += 1;
|
| + pos = (pos + 1) % DEFAULT_LIST.length;
|
| + dispatch();
|
| + }
|
| +}
|
| + </script>
|
| +</body>
|
| +</html>
|
|
|