| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
analyzer: Cache analysis options during _ContextLocator tasks
Work towards https://github.com/dart-lang/sdk/issues/62539
I won't say it's fixed yet, because this only cuts down writes by half, that I can see.
The idea is that _ContextLocator has a set of analysis option caches.
Each cache is stored in a map, mapped from each SourceFactory (for
resolving 'package:' URIs.
I forked the bulk of `getOptionsFromSource` into a private
method `_getOptionsFromSource`, which has two extra parameters:
`required Set<Source> handled` and
`required Map<Uri, YamlMap> optionsCache`, to make sure that those are
_always_ passed in recursive calls, and that they are minimally exposed
in public API.
These caches are not long-lived; they only exist during
ContextLocator's work, and are then garbage-collected. Because of this,
we do not need to be concerned with files changing on disk or in an
OverlayResourceProvider. _ContextLocator is not re-entrant because the
only public API into that class is the top-level `locateContextRoots`
function.
There may be more caching opportunities, I think specifically in
ContextBuilderImpl and in the options validation code.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |