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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart

Issue 11421060: Improve measuring (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
index e84d45c15b1f15e92a1fdf2b013d2f8646884079..af5da25c6a2e2090b66dc79a4ca84e62ef18912b 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
@@ -100,23 +100,25 @@ class Compiler extends leg.Compiler {
}
leg.Script readScript(Uri uri, [tree.Node node]) {
- if (uri.scheme == 'dart') uri = translateDartUri(uri, node);
- var translated = translateUri(uri, node);
- String text = "";
- try {
- // TODO(ahe): We expect the future to be complete and call value
- // directly. In effect, we don't support truly asynchronous API.
- text = provider(translated).value;
- } catch (exception) {
- if (node != null) {
- cancel("$exception", node: node);
- } else {
- reportDiagnostic(null, "$exception", api.Diagnostic.ERROR);
- throw new leg.CompilerCancelledException("$exception");
+ return fileReadingTask.measure(() {
+ if (uri.scheme == 'dart') uri = translateDartUri(uri, node);
+ var translated = translateUri(uri, node);
+ String text = "";
+ try {
+ // TODO(ahe): We expect the future to be complete and call value
+ // directly. In effect, we don't support truly asynchronous API.
+ text = provider(translated).value;
+ } catch (exception) {
+ if (node != null) {
+ cancel("$exception", node: node);
+ } else {
+ reportDiagnostic(null, "$exception", api.Diagnostic.ERROR);
+ throw new leg.CompilerCancelledException("$exception");
+ }
}
- }
- SourceFile sourceFile = new SourceFile(translated.toString(), text);
- return new leg.Script(uri, sourceFile);
+ SourceFile sourceFile = new SourceFile(translated.toString(), text);
+ return new leg.Script(uri, sourceFile);
+ });
}
Uri translateUri(Uri uri, tree.Node node) {
@@ -156,9 +158,14 @@ class Compiler extends leg.Compiler {
bool run(Uri uri) {
bool success = super.run(uri);
+ int cumulated = 0;
for (final task in tasks) {
+ cumulated += task.timing;
log('${task.name} took ${task.timing}msec');
}
+ int total = totalCompileTime.elapsedMilliseconds;
+ log('Total compile-time ${total}msec;'
+ ' unaccounted ${total - cumulated}msec');
return success;
}
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698