mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 14:53:37 +00:00
Use shared FileContentOverlay in AnalysisContextCollection to ensure content sharing.
This improves performance, and it looks that this might be the issue that causes Golem to timeout today. Change-Id: I7a71fb3f6829f55205d8f7fc028245d529501389 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186540 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
2e3d1c2bcd
commit
98c83633a2
|
@ -11,6 +11,7 @@ import 'package:analyzer/file_system/physical_file_system.dart';
|
|||
import 'package:analyzer/src/dart/analysis/byte_store.dart';
|
||||
import 'package:analyzer/src/dart/analysis/context_builder.dart';
|
||||
import 'package:analyzer/src/dart/analysis/driver.dart';
|
||||
import 'package:analyzer/src/dart/analysis/file_state.dart';
|
||||
import 'package:analyzer/src/dart/analysis/performance_logger.dart';
|
||||
import 'package:cli_util/cli_util.dart';
|
||||
|
||||
|
@ -50,6 +51,7 @@ class AnalysisContextCollectionImpl implements AnalysisContextCollection {
|
|||
includedPaths: includedPaths,
|
||||
excludedPaths: excludedPaths,
|
||||
);
|
||||
var fileContentOverlay = FileContentOverlay();
|
||||
for (var root in roots) {
|
||||
var contextBuilder = ContextBuilderImpl(
|
||||
resourceProvider: this.resourceProvider,
|
||||
|
@ -60,6 +62,7 @@ class AnalysisContextCollectionImpl implements AnalysisContextCollection {
|
|||
declaredVariables: DeclaredVariables.fromMap(declaredVariables ?? {}),
|
||||
drainStreams: drainStreams,
|
||||
enableIndex: enableIndex,
|
||||
fileContentOverlay: fileContentOverlay,
|
||||
performanceLog: performanceLog,
|
||||
retainDataForTesting: retainDataForTesting,
|
||||
sdkPath: sdkPath,
|
||||
|
|
|
@ -43,6 +43,7 @@ class ContextBuilderImpl implements ContextBuilder {
|
|||
DeclaredVariables? declaredVariables,
|
||||
bool drainStreams = true,
|
||||
bool enableIndex = false,
|
||||
FileContentOverlay? fileContentOverlay,
|
||||
List<String>? librarySummaryPaths,
|
||||
PerformanceLog? performanceLog,
|
||||
bool retainDataForTesting = false,
|
||||
|
@ -54,7 +55,7 @@ class ContextBuilderImpl implements ContextBuilder {
|
|||
ArgumentError.checkNotNull(sdkPath, 'sdkPath');
|
||||
|
||||
byteStore ??= MemoryByteStore();
|
||||
var fileContentOverlay = FileContentOverlay();
|
||||
fileContentOverlay ??= FileContentOverlay();
|
||||
performanceLog ??= PerformanceLog(StringBuffer());
|
||||
|
||||
DartSdkManager sdkManager = DartSdkManager(sdkPath);
|
||||
|
|
Loading…
Reference in a new issue