Skip to content

dartdoc always parses full markdown even when it doesn't need to #1417

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

Closed
jcollins-g opened this issue May 12, 2017 · 1 comment · Fixed by #1446
Closed

dartdoc always parses full markdown even when it doesn't need to #1417

jcollins-g opened this issue May 12, 2017 · 1 comment · Fixed by #1446
Labels
P2 A bug or feature request we're likely to work on type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

Comments

@jcollins-g
Copy link
Contributor

jcollins-g commented May 12, 2017

Partially because markdown doesn't currently have an option to do otherwise, dartdoc has an issue where we always generate the full HTML for each ModelElement's comment via markdown, even when we don't need to (for example, only the oneLineDoc is used). This mattered less before 0.9.11 and canonicalization as we weren't as picky about what docs we write, but now we're generating and discarding a lot of HTML, repeatedly. Profiling suggests this is why complex packages are slow, because there is a lot of inheritance and a high percentage of non-canonical ModelElements.

Given that we have to run some of the markdown for non-canonical ModelElements so we can have one-line doc summaries, I propose:

  1. adding a markdown feature to only return HTML generated from the first node and using that for oneLineDoc
  2. change macros so we don't need to parse all docs in case one exists
@jcollins-g jcollins-g added type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable P2 A bug or feature request we're likely to work on labels May 12, 2017
@jcollins-g
Copy link
Contributor Author

jcollins-g commented May 22, 2017

A prototype of #1 suggests that that cuts generation time by another 20% for flutter and drops about half of the comment reference lookups during generation. A nice side effect is a squelching of some warnings for docs we never actually write to disk because they weren't part of a oneLineDoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant