-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustdoc: Only store locations in Cache::extern_locations and calculate the other info on-demand #84601
rustdoc: Only store locations in Cache::extern_locations and calculate the other info on-demand #84601
Conversation
r? @ollie27 (rust-highfive has picked a reviewer for you, use r? to override) |
r? @jyn514 |
Hey @jyn514, can I store Or is there a way for me to access it a any time via the context. I feel like this is not possible because I would need the Lines 561 to 565 in 154858c
|
Yes, that's fine :) render_options is kind of a mess, I would rather we keep more things on Cache anyway. |
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.
I think the rest of this is still in progress, right? Feel free to ping me when this is ready for review.
This comment has been minimized.
This comment has been minimized.
…location function
f00355c
to
7417c70
Compare
I have been able to replace all the usages of Cache::extern_locations by some on-demand computation, except for two of them, in My on-demand computation return I printed some debug inside the debug!(?local_location, ?self.crate_num, ?extern_url, ?dst);
debug!("{}", local_location.is_dir()) Here is the output for the call that fill the cache (inside
And here is the output for the on-demand call (inside `rustdoc::html::format::primitive_link):
The arguments are the same but in the on-demand call we enter the following branch:
So my issue seem to be that a new directory have been created been created at Do you see any way we can get out of this situation ? Maybe slightly postponing the directory creation ? |
I don't think this can work because these href() calls happen while rustdoc is writing the HTML files themselves to disk. What we could do instead is generate files to a temporary directory, then rename them all, something like this:
That will only do as many renames as there are crates, so it shouldn't be much slower - on most file systems, directory renames are basically free as long as they happen on the same filesystem. That's a fairly large change, so it may be easier in the meantime to only remove |
7417c70
to
b1ab5cf
Compare
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.
This looks great :) just want to do a perf run first.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit b1ab5cf9f3f2fbfef892327240c28e94011b2d10 with merge 327229fc2f1d5d7595a5edd2bbfaf553d7397b38... |
b1ab5cf
to
2cc2639
Compare
@rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
@rust-timer queue b1ab5cf9f3f2fbfef892327240c28e94011b2d10 |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
@bors try @rust-timer queue include=-doc |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2cc2639 with merge e5668a2fb8fd709b737433c50a467ea877ab5f4b... |
☀️ Try build successful - checks-actions |
Queued e5668a2fb8fd709b737433c50a467ea877ab5f4b with parent a45f0d7, future comparison URL. |
Finished benchmarking try commit (e5668a2fb8fd709b737433c50a467ea877ab5f4b): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Both perf and max-rss look like noise, but this is a nice cleanup :) @bors r+ rollup |
📌 Commit 2cc2639 has been approved by |
Also, given how little perf impact there was, I wouldn't spend too much time on my idea in #84601 (comment) - shrinking |
…xtern_locations, r=jyn514 rustdoc: Only store locations in Cache::extern_locations and calculate the other info on-demand help rust-lang#84588
…xtern_locations, r=jyn514 rustdoc: Only store locations in Cache::extern_locations and calculate the other info on-demand help rust-lang#84588
Rollup of 8 pull requests Successful merges: - rust-lang#84601 (rustdoc: Only store locations in Cache::extern_locations and calculate the other info on-demand) - rust-lang#84704 (platform-support.md: Update for consistency with Target Tier Policy) - rust-lang#84724 (Replace llvm::sys::fs::F_None with llvm::sys::fs::OF_None) - rust-lang#84740 (Reset the docs' copy path button after 1 second) - rust-lang#84749 (Sync `rustc_codegen_cranelift`) - rust-lang#84756 (Add a ToC to the Target Tier Policy documentation) - rust-lang#84765 (Update cargo) - rust-lang#84774 (Fix misspelling) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
help #84588