-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Cache more queries on disk #95418
Cache more queries on disk #95418
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ae9af5f539ba1eca44562ff9a400d8b46cdc66c6 with merge 36ace5e9edc63601569a7ef878ded180015f85d3... |
separate_provide_extern | ||
} | ||
|
||
query impl_constness(def_id: DefId) -> hir::Constness { | ||
desc { |tcx| "looking up whether `{}` is a const impl", tcx.def_path_str(def_id) } | ||
cache_on_disk_if { def_id.is_local() } |
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.
Aren't those two just a cheap hir lookup?
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.
Yes. For the moment, I'm trying some heuristic like "cache everything that will be stored in metadata (roughly if is has separate_provide_extern)". I plan to refine this from perf measurements.
☀️ Try build successful - checks-actions |
Queued 36ace5e9edc63601569a7ef878ded180015f85d3 with parent e2301ca, future comparison URL. |
Finished benchmarking commit (36ace5e9edc63601569a7ef878ded180015f85d3): comparison url. Summary: This benchmark run shows 83 relevant improvements 🎉 but 43 relevant regressions 😿 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
r? rust-lang/compiler |
This comment was marked as outdated.
This comment was marked as outdated.
After investigation, I'm not sure how I can optimize the disk effect. One of the key effects is to avoid recomputing |
If this is waiting on another review from me then all the changes in this PR still look good to me, so r=me if you don't want to do further changes.
I'm not familiar enough with the relevant code to have any suggestions here unfortunately. |
Let's confirm there are no unforeseen regressions, and I think we'll go ahead. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 29f3b3f with merge 439d2588a96abfba733f7cef6e0f998d18042636... |
☀️ Try build successful - checks-actions |
Queued 439d2588a96abfba733f7cef6e0f998d18042636 with parent 3655175, future comparison URL. |
Finished benchmarking commit (439d2588a96abfba733f7cef6e0f998d18042636): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Footnotes |
@bors r=davidtwco |
📌 Commit 29f3b3f has been approved by |
This PR caches many more queries' results on disk. The queries have been chosen to be: (1) outputs of typechecking, and (2) parts of metadata. This caching allows for wide and large compile time savings, up to 36%. The tradeoff is a compile time increase (4%) when these caches cannot be usefully used, and a increased on-disk size around 30%. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e6a4afc): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
One of the principles of incremental compilation is to allow saving results on disk to avoid recomputing them.
This PR investigates persisting a lot of queries whose result are to be saved into metadata.
Some of the queries are cheap reads from HIR, but we may also want to get rid of these reads for incremental lowering.