[S] Change in dart/sdk[main]: analyzer: Store fewer objects to track analysis options

0 views
Skip to first unread message

Samuel Rawlins (Gerrit)

unread,
Dec 16, 2025, 11:08:17 AM (5 days ago) Dec 16
to Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Paul Berry

Samuel Rawlins voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Paul Berry
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ib6d6fbc378ccd6e473103b43f6ef4e7d4f85a69b
Gerrit-Change-Number: 468460
Gerrit-PatchSet: 3
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Paul Berry <paul...@google.com>
Gerrit-Comment-Date: Tue, 16 Dec 2025 16:08:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Paul Berry (Gerrit)

unread,
Dec 17, 2025, 2:56:37 PM (4 days ago) Dec 17
to Samuel Rawlins, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Samuel Rawlins

Paul Berry voted and added 1 comment

Votes added by Paul Berry

Code-Review+1

1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Samuel Rawlins
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ib6d6fbc378ccd6e473103b43f6ef4e7d4f85a69b
Gerrit-Change-Number: 468460
Gerrit-PatchSet: 3
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Wed, 17 Dec 2025 19:56:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Dec 17, 2025, 8:39:09 PM (4 days ago) Dec 17
to Samuel Rawlins, Paul Berry, dart-analys...@google.com, rev...@dartlang.org

Commit Queue submitted the change

Change information

Commit message:
analyzer: Store fewer objects to track analysis options

Previously, `ContextRoot.optionsFileMap` mapped each Folder to the analysis options File which applies to it. _Each Folder_. For example,
when playing around with the `analyzer_testing` package, which has one
analysis options file, but around ~20 subfolders, there were 20 entries
in this map.

Similarly, when `ContextBuilder._createOptionsMap` iterated over that
map, it would _read from disk_ the options file that applied to each
folder (which is all just the one options file), parse it, and store an
AnalysisOptionsImpl file representing the options that apply to each
folder.

This change flips the map, so that we track options files as keys, and
the folders they apply to as a list of the folders. This results in
fewer map entries, fewer File objects, and fewer AnalysisOptionsImpl
objects (which themselves have many nested fields, like plugin
configurations and enabled lint rules).
Change-Id: Ib6d6fbc378ccd6e473103b43f6ef4e7d4f85a69b
Reviewed-by: Paul Berry <paul...@google.com>
Commit-Queue: Samuel Rawlins <sraw...@google.com>
Files:
  • M pkg/analyzer/lib/src/dart/analysis/context_builder.dart
  • M pkg/analyzer/lib/src/dart/analysis/context_locator.dart
  • M pkg/analyzer/lib/src/dart/analysis/context_root.dart
  • M pkg/analyzer/test/src/dart/analysis/analysis_context_collection_test.dart
Change size: S
Delta: 4 files changed, 11 insertions(+), 9 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Paul Berry
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ib6d6fbc378ccd6e473103b43f6ef4e7d4f85a69b
Gerrit-Change-Number: 468460
Gerrit-PatchSet: 4
Gerrit-Owner: Samuel Rawlins <sraw...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages