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
Steel thread for new lookup code #2622
Conversation
…markdown_processor
…ence (parameters can't be linked to)
Small PR; should be a quick review 😛 Seriously though, I'll prioritize reviewing this. |
I'm hoping the review won't be too bad; a good portion of the line count is boilerplate and generated file changes. |
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.
Reviewed 27/34 files so far. Thought I'd mail out what I have so far.
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.
Very excited.
@@ -0,0 +1,81 @@ | |||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file |
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.
2021?
Have you done a benchmark of the experimental resolution vs the current resolution? Seems like replacing the algorithm could really affect runtime and also peak memory. |
@srawlins some benchmark results: SDK is 1375M peak memory in new code vs 1509M. I expect this to improve with further commits; it's likely we're still hanging onto or generating some tables we no longer need. Documentation generation stage for the SDK is 93.4 seconds vs 101.9 seconds in the old code. I can't fully predict yet whether this will improve or degrade as the implementation improves -- I'm hoping that when we are no longer generating the detailed warning messages for references we can't resolve currently and when we clean up the table generation we'll gain some back, but there are probably some cases we have to implement that could slow us down. |
Whoa those benchmark results are really promising! I mean, this new impl wasn't intended to improve performance, and generally speaking, improved algorithms come with more memory and/or speed. It's great even if this work keeps them on par, but improving one or both would be stellar. |
This implements (but does not activate by default) a new comment reference resolution system for dartdoc that can help us migrate off the heuristic trickery currently in
markdown_processor.dart
and finish the extension method implementation.The new one is known to have unimpressive accuracy for now, but should improve with further commits.
An example with the self-checking code turned on to run both kinds of resolution and compare their results:
The new code produces equivalent results to the old one 68% of the time on the SDK, meaning that if we switched this code on today we'd have a different results for about a third of the comment references in the SDK (presumably, wrongly). We can iterate down on this by checking the generated warnings and removing differences when appropriate, adding tests for them, and ensuring that extension methods work properly with new tests.