Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 38ac261

Browse files
simolus3Commit Queue
authored and
Commit Queue
committed
[analyzer] Add byteStore option for build_resolvers client
At the moment, we always use an in-memory store for computed units and elements. By persisting this to file and re-using it across builds, we can speed up subsequent build runs. Change-Id: I6fca9d96f6961a3a802eb1d4cb21682fc0fcc469 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270400 Reviewed-by: Konstantin Shcheglov <[email protected]> Auto-Submit: Simon <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 15c8f28 commit 38ac261

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/analyzer/lib/src/clients/build_resolvers/build_resolvers.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import 'package:analyzer/src/summary/summary_sdk.dart';
1818
import 'package:analyzer/src/summary2/package_bundle_format.dart';
1919

2020
export 'package:analyzer/src/context/packages.dart' show Packages, Package;
21+
export 'package:analyzer/src/dart/analysis/byte_store.dart' show ByteStore;
2122
export 'package:analyzer/src/dart/analysis/experiments.dart'
2223
show ExperimentStatus;
2324
export 'package:analyzer/src/generated/engine.dart'
@@ -37,6 +38,7 @@ AnalysisDriverForPackageBuild createAnalysisDriver({
3738
required AnalysisOptions analysisOptions,
3839
required List<UriResolver> uriResolvers,
3940
required Packages packages,
41+
ByteStore? byteStore,
4042
}) {
4143
var sdkBundle = PackageBundleReader(sdkSummaryBytes);
4244
var sdk = SummaryBasedDartSdk.forBundle(sdkBundle);
@@ -55,7 +57,7 @@ AnalysisDriverForPackageBuild createAnalysisDriver({
5557
scheduler: scheduler,
5658
logger: logger,
5759
resourceProvider: resourceProvider,
58-
byteStore: MemoryByteStore(),
60+
byteStore: byteStore ?? MemoryByteStore(),
5961
sourceFactory: sourceFactory,
6062
analysisOptions: analysisOptions as AnalysisOptionsImpl,
6163
externalSummaries: dataStore,

0 commit comments

Comments
 (0)