-
Notifications
You must be signed in to change notification settings - Fork 124
Convert to using a single AnalysisDriver in place of a single AnalysisContext. #1598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Comparison with master branch shows dartdoc as significantly slower (~15%) with this change. Haven't dug into why yet. It might be that one of the workarounds is imposing a penalty, or the AnalysisDriver itself could just be a bit slower. From
|
@scheglov I'm no expert at Observatory, but poking around with it while comparing versions implicates computeNode() as being much slower under the |
Hypothesis seems to hold up -- removing computeNode from annotation building (which is where we used it most heavily) cuts the performance penalty to 5%. Fortunately, that seems possible now and apparently with equal accuracy to using computeNode. |
Did a little bit more cleanup; should be stable for review again once green. |
@scheglov, @bwilkerson, can you review? This is converting dartdoc to use the analysis driver. |
lib/src/model.dart
Outdated
@@ -5122,8 +5130,8 @@ class PackageBuilder { | |||
/// Parse a single library at [filePath] using the current analysis context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
analysis driver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -5140,15 +5148,16 @@ class PackageBuilder { | |||
if (uri != null) { | |||
source = new FileBasedSource(javaFile, uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still use java files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently so. It looks like it might be possible to eliminate some of the usage (the TODO above), but we still need them for finding the analysis errors we care about later on.
Fixes #1586.
Dartdoc has never correctly instantiated groups of AnalysisContexts, and still doesn't correctly instantiate groups of AnalysisDrivers. But we do actually instantiate a single AnalysisDriver now instead of AnalysisContext, so that's progress.