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

Unified Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 2005403005: Gather and report stats on the number of times flushed results are recomputed (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/status/get_handler.dart ('k') | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/cache.dart
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart
index 36df855dde96e00fc4a7ca02700db0e153df2ea9..ae7961546a45a8f433ac8b2bf88b5b653f4f30fa 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -286,6 +286,13 @@ class CacheEntry {
static int nextInvalidateId = 0;
/**
+ * A table containing the number of times the value of a result descriptor was
+ * recomputed after having been flushed.
+ */
+ static final Map<ResultDescriptor, int> recomputedCounts =
+ new HashMap<ResultDescriptor, int>();
+
+ /**
* The target this entry is about.
*/
final AnalysisTarget target;
@@ -530,6 +537,10 @@ class CacheEntry {
}
ResultData data = getResultData(descriptor);
_setDependedOnResults(data, thisResult, dependedOn);
+ if (data.state == CacheState.FLUSHED) {
+ int count = recomputedCounts[descriptor] ?? 0;
+ recomputedCounts[descriptor] = count + 1;
+ }
data.state = CacheState.VALID;
data.value = value ?? descriptor.defaultValue;
}
« no previous file with comments | « pkg/analysis_server/lib/src/status/get_handler.dart ('k') | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698