Skip to content

Commit 4d3ec06

Browse files
committed
Add more data and performance operations for Cider.
[email protected], [email protected] Change-Id: If2ad5135a8de977f92300e6c2480891ab02c6458 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155721 Reviewed-by: Keerti Parthasarathy <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 3103d85 commit 4d3ec06

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

pkg/analysis_server/lib/src/cider/completion.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ class CiderCompletionComputer {
207207
@required LibraryElement element,
208208
@required OperationPerformanceImpl performance,
209209
}) {
210+
performance.getDataInt('libraryCount').increment();
211+
210212
var path = element.source.fullName;
211213
var signature = _fileResolver.getLibraryLinkedSignature(
212214
path: path,
@@ -215,6 +217,7 @@ class CiderCompletionComputer {
215217

216218
var cacheEntry = _cache._importedLibraries[path];
217219
if (cacheEntry == null || cacheEntry.signature != signature) {
220+
performance.getDataInt('libraryCompute').increment();
218221
computedImportedLibraries.add(path);
219222
var suggestions = _librarySuggestions(element);
220223
cacheEntry = _CiderImportedLibrarySuggestions(

pkg/analyzer/lib/src/dart/micro/library_analyzer.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ class LibraryAnalyzer {
127127
// Resolve URIs in directives to corresponding sources.
128128
FeatureSet featureSet = units[_library].featureSet;
129129

130-
units.forEach((file, unit) {
131-
_validateFeatureSet(unit, featureSet);
132-
_resolveUriBasedDirectives(file, unit);
130+
performance.run('resolveUriDirectives', (performance) {
131+
units.forEach((file, unit) {
132+
_validateFeatureSet(unit, featureSet);
133+
_resolveUriBasedDirectives(file, unit);
134+
});
133135
});
134136

135-
_libraryElement = _elementFactory.libraryOfUri(_library.uriStr);
137+
performance.run('libraryElement', (performance) {
138+
_libraryElement = _elementFactory.libraryOfUri(_library.uriStr);
139+
});
136140

137141
performance.run('resolveDirectives', (performance) {
138142
_resolveDirectives(units, forCompletion);

0 commit comments

Comments
 (0)