Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: test/perf/input/todomvc3_test.html

Issue 11683002: Setting up benchmarks and perf utilities (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: john comments Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/perf/input/todomvc2_test.html ('k') | test/perf/input/todomvc_async_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 5 BSD-style license that can be found in the LICENSE file.
6 --> 6 -->
7 <html lang="en"> 7 <html lang="en">
8 <head> 8 <head>
9 <!-- 9 <!--
10 This test runs the TodoMVC app and evaluates that it renders correctly if a 10 This performance test runs the TodoMVC app and uses the application as follows:
11 single item is present in the todo list. 11 * adds 10 todos once.
12 * on each benchmark iteration update the text on one of them.
12 --> 13 -->
13 <meta charset="utf-8"> 14 <meta charset="utf-8">
14 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 15 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
15 <link rel="components" href="example/todomvc/router_options.html"> 16 <link rel="components" href="example/todomvc/router_options.html">
16 <link rel="components" href="example/todomvc/todo_row.html"> 17 <link rel="components" href="example/todomvc/todo_row.html">
17 <link rel="stylesheet" href="example/todomvc/base.css"> 18 <link rel="stylesheet" href="example/todomvc/base.css">
18 <script type="application/javascript" src="testing.js"></script> 19 <script type="application/javascript" src="testing.js"></script>
20 <script type="application/javascript" src="start_dart.js"></script>
19 <title>dart - TodoMVC</title> 21 <title>dart - TodoMVC</title>
20 </head> 22 </head>
21 <body> 23 <body>
22 <section id="todoapp"> 24 <section id="todoapp">
23 <header id="header"> 25 <header id="header">
24 <h1 class='title'>todos</h1> 26 <h1 class='title'>todos</h1>
25 <form on-submit="addTodo($event)"> 27 <form on-submit="addTodo($event)">
26 <input id="new-todo" placeholder="What needs to be done?" autofocus 28 <input id="new-todo" placeholder="What needs to be done?" autofocus
27 on-change="addTodo($event)"> 29 on-change="addTodo($event)">
28 </form> 30 </form>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 <p> 62 <p>
61 Learn more about 63 Learn more about
62 <a href="https://www.dartlang.org/articles/dart-web-components/">Dart + We b Components</a> 64 <a href="https://www.dartlang.org/articles/dart-web-components/">Dart + We b Components</a>
63 or 65 or
64 <a href="https://github.com/dart-lang/web-ui/tree/master/example/todomvc"> view the source</a>. 66 <a href="https://github.com/dart-lang/web-ui/tree/master/example/todomvc"> view the source</a>.
65 </p> 67 </p>
66 <p>Part of <a href="http://todomvc.com">TodoMVC</a>.</p> 68 <p>Part of <a href="http://todomvc.com">TodoMVC</a>.</p>
67 </footer> 69 </footer>
68 <script type="application/dart"> 70 <script type="application/dart">
69 import 'dart:html'; 71 import 'dart:html';
72 import 'package:unittest/unittest.dart';
70 import 'package:web_ui/web_ui.dart'; 73 import 'package:web_ui/web_ui.dart';
71 import 'example/todomvc/main.dart' as todomvc_main; 74 import 'example/todomvc/main.dart' as todomvc_main;
72 import 'example/todomvc/model.dart'; 75 import 'example/todomvc/model.dart';
76 import 'perf_common.dart';
77 import 'todomvc_common.dart';
73 78
74 final addTodo = todomvc_main.addTodo; 79 final addTodo = todomvc_main.addTodo;
75 80
76 main() { 81 main() {
82 useShadowDom = false;
77 todomvc_main.main(); 83 todomvc_main.main();
78 window.setTimeout(() { 84 window.setTimeout(() {
79 app.todos.add(new Todo('hola')); 85 var bench = new TodoMvcBenchmark();
86 perfDone(bench.measure());
87 }, 0);
88 }
89
90 class TodoMvcBenchmark extends BenchmarkBase {
91 TodoMvcBenchmark() : super('todomvc3');
92 void setup() {
93 app.todos.clear();
94 for (int i = 0; i < 10; i++) {
95 addNote("item $i");
96 }
97 count = 0;
98 }
99
100 int count;
101 void run() {
102 count++;
103 app.todos[3].task = 'item 4: $count';
80 dispatch(); 104 dispatch();
81 window.setTimeout(() => window.postMessage('done', '*'), 0); 105 }
82 }, 0);
83 } 106 }
84 </script> 107 </script>
85 </body> 108 </body>
86 </html> 109 </html>
OLDNEW
« no previous file with comments | « test/perf/input/todomvc2_test.html ('k') | test/perf/input/todomvc_async_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698