- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
I-compilememIssue: Problems and improvements with respect to memory usage during compilation.Issue: Problems and improvements with respect to memory usage during compilation.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
In doing some perf debugging on something else, I added eprintln output here:
rust/src/librustdoc/clean/types.rs
Line 462 in 63fdb82
| if let Ok((mut href, ..)) = href(*id, cx) { |
And was surprised to find that for the stm32f4 crate, building with a single feature enabled, that line of code was hit 16,000,000 times even though only 4,000 documentation pages were being generated.
It turns out that the blanket impl for Into<U> for T where U: From<T> uses an intra-doc link:
rust/library/core/src/convert/mod.rs
Line 724 in 63fdb82
| /// <code>[From]<T> for U</code> chooses to do. |
So apparently that link gets inserted into the intra_doc_links: FxHashMap<ItemId, Vec<clean::ItemLink>> multiple times, once for each page (since every page includes this blanket impl); and then each time links() is called, it iterates through all 4,000 entries.
Metadata
Metadata
Assignees
Labels
I-compilememIssue: Problems and improvements with respect to memory usage during compilation.Issue: Problems and improvements with respect to memory usage during compilation.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.