| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 for details. All rights reserved. Use of this source code is governed by a |
| 5 BSD-style license that can be found in the LICENSE file. |
| 6 --> |
| 7 <html lang="en"> |
| 8 <head> |
| 9 <!-- |
| 10 This performance test updates a list of 10 elements used in 10 loops. |
| 11 --> |
| 12 <meta charset="utf-8"> |
| 13 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 14 <script type="application/javascript" src="testing.js"></script> |
| 15 <script type="application/javascript" src="start_dart.js"></script> |
| 16 </head> |
| 17 <body> |
| 18 <template iterate="x in list"><span>{{x}}</span></template> |
| 19 <template iterate="x in list"><span>{{x}}</span></template> |
| 20 <template iterate="x in list"><span>{{x}}</span></template> |
| 21 <template iterate="x in list"><span>{{x}}</span></template> |
| 22 <template iterate="x in list"><span>{{x}}</span></template> |
| 23 <template iterate="x in list"><span>{{x}}</span></template> |
| 24 <template iterate="x in list"><span>{{x}}</span></template> |
| 25 <template iterate="x in list"><span>{{x}}</span></template> |
| 26 <template iterate="x in list"><span>{{x}}</span></template> |
| 27 <template iterate="x in list"><span>{{x}}</span></template> |
| 28 <script type="application/dart"> |
| 29 import 'dart:html'; |
| 30 import 'package:web_ui/web_ui.dart'; |
| 31 import 'package:unittest/unittest.dart'; |
| 32 import 'perf_common.dart'; |
| 33 |
| 34 main() { |
| 35 useShadowDom = false; |
| 36 window.setTimeout(() { |
| 37 var bench = new LoopBenchmark(); |
| 38 perfDone(bench.measure()); |
| 39 }, 0); |
| 40 } |
| 41 |
| 42 const DEFAULT_LIST = const [ |
| 43 0, 100, 200, 300, 400, 500, 600, 700, 800, 900, |
| 44 ]; |
| 45 |
| 46 List list = []; |
| 47 |
| 48 class LoopBenchmark extends BenchmarkBase { |
| 49 LoopBenchmark() : super('loop-10-10'); |
| 50 int pos = 0; |
| 51 setup() { |
| 52 list.clear(); |
| 53 list.addAll(DEFAULT_LIST); |
| 54 pos = 0; |
| 55 } |
| 56 |
| 57 run() { |
| 58 list[pos] += 1; |
| 59 pos = (pos + 1) % DEFAULT_LIST.length; |
| 60 dispatch(); |
| 61 } |
| 62 } |
| 63 </script> |
| 64 </body> |
| 65 </html> |
| OLD | NEW |