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

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

Issue 2297343002: Flush results when contexts are made idle. (Closed)
Patch Set: Un-fail completion tests. Created 4 years, 4 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/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 2a464756b2b5d2286389f780cc9245a16e5a8940..283d8204a65840fa3a1254ca94bf93bdb4d3a077 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -49,7 +49,16 @@ import 'package:analyzer/task/model.dart';
* The [ResultCachingPolicy] for ASTs.
*/
const ResultCachingPolicy<CompilationUnit> AST_CACHING_POLICY =
- const SimpleResultCachingPolicy(16384, 16384);
+ const SimpleResultCachingPolicy(16384, 32);
+
+/**
+ * The [ResultCachingPolicy] for fully resolved ASTs. It is separated from
+ * [AST_CACHING_POLICY] because we want to keep some number of fully resolved
+ * ASTs when users switch between contexts, and they should not be pushed out
+ * of the cache by temporary partially resolved ASTs.
+ */
+const ResultCachingPolicy<CompilationUnit> AST_RESOLVED_CACHING_POLICY =
+ const SimpleResultCachingPolicy(1024, 32);
/**
* The [ResultCachingPolicy] for ASTs that can be reused when a library
@@ -60,7 +69,7 @@ const ResultCachingPolicy<CompilationUnit> AST_CACHING_POLICY =
* once analysis is done, they can be flushed.
*/
const ResultCachingPolicy<CompilationUnit> AST_REUSABLE_CACHING_POLICY =
- const SimpleResultCachingPolicy(1024, 1024);
+ const SimpleResultCachingPolicy(1024, 64);
/**
* The [ResultCachingPolicy] for lists of [ConstantEvaluationTarget]s.
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698