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

Side by Side Diff: benchmarks/mojo_rtt_benchmark/lib/main.dart

Issue 1964193002: Dart: Refactors Proxies (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address comments Created 4 years, 7 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 | « no previous file | examples/dart/camera_roll/lib/main.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This Mojo app is a benchmark of Mojo/Dart IPC Round Trip Times. 5 // This Mojo app is a benchmark of Mojo/Dart IPC Round Trip Times.
6 // It creates many proxies from a single isolate, and makes requests using those 6 // It creates many proxies from a single isolate, and makes requests using those
7 // proxies round-robin. 7 // proxies round-robin.
8 // To run it, and the other RTT benchmarks: 8 // To run it, and the other RTT benchmarks:
9 // 9 //
10 // $ ./mojo/devtools/common/mojo_benchmark [--release] mojo/tools/data/rtt_bench marks 10 // $ ./mojo/devtools/common/mojo_benchmark [--release] mojo/tools/data/rtt_bench marks
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Using the sync API means that we only record one event after the finish 89 // Using the sync API means that we only record one event after the finish
90 // time has been recorded. 90 // time has been recorded.
91 Timeline.startSync("ping"); 91 Timeline.startSync("ping");
92 return _echo(idx, s).then((r) { 92 return _echo(idx, s).then((r) {
93 Timeline.finishSync(); 93 Timeline.finishSync();
94 return r; 94 return r;
95 }); 95 });
96 } 96 }
97 97
98 Future _echo(int idx, String s) { 98 Future _echo(int idx, String s) {
99 return _echoProxies[idx].ptr.echoString(s); 99 return _echoProxies[idx].echoString(s);
100 } 100 }
101 101
102 _errorHandler(Object e) { 102 _errorHandler(Object e) {
103 _doEcho = false; 103 _doEcho = false;
104 return Future.wait(_echoProxies.map((p) => p.close())).then((_) { 104 return Future.wait(_echoProxies.map((p) => p.close())).then((_) {
105 MojoHandle.reportLeakedHandles(); 105 MojoHandle.reportLeakedHandles();
106 }); 106 });
107 } 107 }
108 } 108 }
109 109
110 main(List args, Object handleToken) { 110 main(List args, Object handleToken) {
111 MojoHandle appHandle = new MojoHandle(handleToken); 111 MojoHandle appHandle = new MojoHandle(handleToken);
112 new EchoTracingApp.fromHandle(appHandle); 112 new EchoTracingApp.fromHandle(appHandle);
113 } 113 }
OLDNEW
« no previous file with comments | « no previous file | examples/dart/camera_roll/lib/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698