Uh oh!
There was an error while loading. Please reload this page.
[experiment] How expensive are doc comments? - #60930
Conversation
petrochenkov
commented
May 18, 2019
@bors try |
bors
commented
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
rust-highfive
commented
May 18, 2019
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 |
bors
commented
May 18, 2019
☀️ Try build successful - checks-travis |
Centril
commented
May 18, 2019
@rust-timer build 87205d7 |
rust-timer
commented
May 18, 2019
Success: Queued 87205d7 with parent 73a3a90, comparison URL. |
rust-timer
commented
May 18, 2019
Finished benchmarking try commit 87205d7: comparison url |
Centril
commented
May 18, 2019
Turns out they are pretty expensive... |
petrochenkov
commented
May 18, 2019
nnethercote
commented
Oct 23, 2019
Note that my experiments indicate that the main part of the cost is decoding the attributes from metadata. |
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
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