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

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 959543005: Measure time spent running pub (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/analysis_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index e0ad10d1805d6da2de34304a7e903f05edcfc1a4..26b1136053cec44a328263fa99361455e2fc5322 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -7,6 +7,7 @@ library context.directory.manager;
import 'dart:async';
import 'dart:collection';
+import 'package:analysis_server/src/analysis_server.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/source/package_map_provider.dart';
import 'package:analyzer/source/package_map_resolver.dart';
@@ -326,8 +327,10 @@ abstract class ContextManager {
return new PackageUriResolver([new JavaFile(info.packageRoot)]);
} else {
beginComputePackageMap();
- PackageMapInfo packageMapInfo =
- _packageMapProvider.computePackageMap(folder);
+ PackageMapInfo packageMapInfo;
+ ServerPerformanceStatistics.pub.makeCurrentWhile(() {
+ packageMapInfo = _packageMapProvider.computePackageMap(folder);
+ });
endComputePackageMap();
info.packageMapDependencies = packageMapInfo.dependencies;
if (packageMapInfo.packageMap == null) {
@@ -361,20 +364,6 @@ abstract class ContextManager {
}
/**
- * Create a new context associated with the given [folder]. The [pubspecFile]
- * is the `pubspec.yaml` file contained in the folder. Add any sources that
- * are not included in one of the [children] to the context.
- */
- _ContextInfo _createContextWithSources(Folder folder, File pubspecFile,
- List<_ContextInfo> children) {
- _ContextInfo info = _createContext(folder, pubspecFile, children);
- ChangeSet changeSet = new ChangeSet();
- _addSourceFiles(changeSet, folder, info);
- applyChangesToContext(folder, changeSet);
- return info;
- }
-
- /**
* Creates a new context associated with [folder].
*
* If there are subfolders with 'pubspec.yaml' files, separate contexts
@@ -414,6 +403,20 @@ abstract class ContextManager {
}
/**
+ * Create a new context associated with the given [folder]. The [pubspecFile]
+ * is the `pubspec.yaml` file contained in the folder. Add any sources that
+ * are not included in one of the [children] to the context.
+ */
+ _ContextInfo _createContextWithSources(Folder folder, File pubspecFile,
+ List<_ContextInfo> children) {
+ _ContextInfo info = _createContext(folder, pubspecFile, children);
+ ChangeSet changeSet = new ChangeSet();
+ _addSourceFiles(changeSet, folder, info);
+ applyChangesToContext(folder, changeSet);
+ return info;
+ }
+
+ /**
* Clean up and destroy the context associated with the given folder.
*/
void _destroyContext(Folder folder) {
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698