[experiment] How expensive are doc comments?#60930
Closed
petrochenkov wants to merge 1 commit intorust-lang:masterfrom
Closed
[experiment] How expensive are doc comments?#60930petrochenkov wants to merge 1 commit intorust-lang:masterfrom
petrochenkov wants to merge 1 commit intorust-lang:masterfrom
Conversation
Contributor
Author
|
@bors try |
Collaborator
bors
added a commit
that referenced
this pull request
May 18, 2019
[experiment] How expensive are doc comments? What happens if they are interpreted as usual comments and not converted to attributes, and not stored in AST/HIR? (This cannot be checked at lexer level, unfortunately, since some popular crates (`rayon`) rely on `/** text */` being matched by `#[$meta]` in macros.) r? @ghost
Contributor
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Collaborator
|
☀️ Try build successful - checks-travis |
Contributor
|
@rust-timer build 87205d7 |
Collaborator
|
Success: Queued 87205d7 with parent 73a3a90, comparison URL. |
Collaborator
|
Finished benchmarking try commit 87205d7: comparison url |
Contributor
|
Turns out they are pretty expensive... |
This was referenced May 18, 2019
Contributor
Author
Contributor
|
Note that my experiments indicate that the main part of the cost is decoding the attributes from metadata. |
Merged
bors
added a commit
that referenced
this pull request
Nov 7, 2019
Cheaper doc comments This PR implements the idea from #60935: represent doc comments more cheaply, rather than converting them into `#[doc="..."]` attribute form. Unlike #60936 (which is about coalescing doc comments to reduce their number), this approach does not have any backwards compatibility concerns, and it eliminates about 80-90% of the current cost of doc comments (as estimated using the numbers in #60930, which eliminated the cost of doc comments entirely by treating them as normal comments). r? @petrochenkov
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happens if they are interpreted as usual comments and not converted to attributes, and not stored in AST/HIR?
(This cannot be checked at lexer level, unfortunately, since some popular crates (
rayon) rely on/** text */being matched by#[$meta]in macros.)r? @ghost