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

Unified Diff: pkg/analyzer/lib/src/task/driver.dart

Issue 1161183004: Another tweak for displaying performance. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/get_handler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/driver.dart
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index 87929c0cb2fb75ec6d10b1a4f2ce4b51ba7c449e..ad76d3dd2aae9ab2c4daa7b44933ad77177a73b0 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -17,6 +17,9 @@ import 'package:analyzer/src/task/inputs.dart';
import 'package:analyzer/src/task/manager.dart';
import 'package:analyzer/task/model.dart';
+final PerformanceTag workOrderMoveNextPerfTag =
+ new PerformanceTag('WorkOrder.moveNext');
+
/**
* An object that is used to cause analysis to be performed until all of the
* required analysis information has been computed.
@@ -716,29 +719,31 @@ class WorkOrder implements Iterator<WorkItem> {
@override
bool moveNext() {
- if (currentItems != null && currentItems.length > 1) {
- // Yield more items.
- currentItems.removeLast();
- return true;
- } else {
- // Get a new strongly connected component.
- StronglyConnectedComponent<WorkItem> nextStronglyConnectedComponent =
- _dependencyWalker.getNextStronglyConnectedComponent();
- if (nextStronglyConnectedComponent == null) {
- currentItems = null;
- return false;
- }
- currentItems = nextStronglyConnectedComponent.nodes;
- if (nextStronglyConnectedComponent.containsCycle) {
- // A cycle has been found.
- for (WorkItem item in currentItems) {
- item.dependencyCycle = currentItems.toList();
- }
+ return workOrderMoveNextPerfTag.makeCurrentWhile(() {
+ if (currentItems != null && currentItems.length > 1) {
+ // Yield more items.
+ currentItems.removeLast();
+ return true;
} else {
- assert(currentItems.length == 1);
+ // Get a new strongly connected component.
+ StronglyConnectedComponent<WorkItem> nextStronglyConnectedComponent =
+ _dependencyWalker.getNextStronglyConnectedComponent();
+ if (nextStronglyConnectedComponent == null) {
+ currentItems = null;
+ return false;
+ }
+ currentItems = nextStronglyConnectedComponent.nodes;
+ if (nextStronglyConnectedComponent.containsCycle) {
+ // A cycle has been found.
+ for (WorkItem item in currentItems) {
+ item.dependencyCycle = currentItems.toList();
+ }
+ } else {
+ assert(currentItems.length == 1);
+ }
+ return true;
}
- return true;
- }
+ });
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/get_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698