mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:27:43 +00:00
Only compute canonical names and clean new libraries
analysis-server-cold-analysis reduced from ~70 seconds to ~46 seconds. Change-Id: I6e793f292beceda32817675625df90cd003bc19c Reviewed-on: https://dart-review.googlesource.com/70264 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Kevin Millikin <kmillikin@google.com>
This commit is contained in:
parent
3aa40c9625
commit
4179fbcec7
|
@ -245,9 +245,13 @@ class FrontEndCompiler {
|
|||
}
|
||||
});
|
||||
|
||||
// TODO(scheglov) Only for new libraries?
|
||||
_component.computeCanonicalNames();
|
||||
_component.accept(new _ShadowCleaner());
|
||||
_ShadowCleaner cleaner = new _ShadowCleaner();
|
||||
for (var library in _component.libraries) {
|
||||
if (!_results.containsKey(library.importUri)) {
|
||||
_component.computeCanonicalNamesForLibrary(library);
|
||||
library.accept(cleaner);
|
||||
}
|
||||
}
|
||||
|
||||
_logger.run('Compute dependencies', _computeDependencies);
|
||||
|
||||
|
|
|
@ -5353,11 +5353,15 @@ class Component extends TreeNode {
|
|||
|
||||
void computeCanonicalNames() {
|
||||
for (var library in libraries) {
|
||||
root.getChildFromUri(library.importUri).bindTo(library.reference);
|
||||
library.computeCanonicalNames();
|
||||
computeCanonicalNamesForLibrary(library);
|
||||
}
|
||||
}
|
||||
|
||||
void computeCanonicalNamesForLibrary(Library library) {
|
||||
root.getChildFromUri(library.importUri).bindTo(library.reference);
|
||||
library.computeCanonicalNames();
|
||||
}
|
||||
|
||||
void unbindCanonicalNames() {
|
||||
root.unbindAll();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue