-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Query-ify global limit attribute handling #86674
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit bfd7c7bb2b2a2c681a0c1ad00eee713d94e0010e with merge d606f2fd5e1ab800c6f9c463b1d637e2c9d884bf... |
☀️ Try build successful - checks-actions |
Queued d606f2fd5e1ab800c6f9c463b1d637e2c9d884bf with parent 49ba936, future comparison URL. |
Finished benchmarking try commit (d606f2fd5e1ab800c6f9c463b1d637e2c9d884bf): comparison url. Summary: This benchmark run did not return any significant changes. 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. 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 |
Error: Label perf-regression can only be set by Rust team members Please let |
Thanks for the PR, @Aaron1011! I'll take a closer look shortly. |
OK, overall this looks good to me. Getting things out of Some remarks:
|
@rylev, potential problem with performance regression bot above: #86674 (comment) |
@michaelwoerister thanks! This has been fixed in #86687 |
I think the granularity could potentially make a difference - for example, changing the |
bfd7c7b
to
9a6cd1a
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 9a6cd1a0d5a1db64b502d849edde2d9888f8b9ec with merge 27b275a44087f0a094822f466836c4503ba6a229... |
☀️ Try build successful - checks-actions |
Finished benchmarking try commit (27b275a44087f0a094822f466836c4503ba6a229): comparison url. Summary: This change led to significant improvements 🎉 in compiler performance.
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. 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 |
Thanks for implementing the optimizations, @Aaron1011! I doesn't look like they made a huge difference but I think it's a good idea to have them anyway.
Yes, that's true. However, my thinking was that one very rarely adjusts those limits and thus this is a good trade-off between code readability and compile-time. |
9a6cd1a
to
7e5a88a
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 7e5a88a with merge 14d9c8245e32b898bc02bf215c498b682881f5d7... |
☀️ Try build successful - checks-actions |
Queued 14d9c8245e32b898bc02bf215c498b682881f5d7 with parent 9044245, future comparison URL. |
Finished benchmarking try commit (14d9c8245e32b898bc02bf215c498b682881f5d7): comparison url. Summary: This benchmark run did not return any significant changes. 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. @bors rollup=never |
OK, bundling the queries together didn't seem to make a difference performance-wise. But I think the code looks cleaner at the usage sites this way. Heads up performance triage: This PR introduces a slight regression in some incr. comp. cases because it fixes a dependency tracking hole and thus introduces some new tracking overhead. @Aaron1011 has already tried to optimize away some of that overhead as part of the PR, with limited effect unfortunately. But even if the overhead is here to stay, I think it is justified because it removes a potential source bugs. Thanks for iterating on the PR, @Aaron1011! @bors r+ |
📌 Commit 7e5a88a has been approved by |
☀️ Test successful - checks-actions |
Currently, we read various 'global limits' from inner attributes the crate root (
recursion_limit
,move_size_limit
,type_length_limit
,const_eval_limit
). These limits are then stored inSessions
, allowing them to be access from aTyCtxt
without registering a dependency on the crate root attributes.This PR moves the calculation of these global limits behind queries, so that we properly track dependencies on crate root attributes. During the setup of macro expansion (before we've created a
TyCtxt
), we need to access the recursion limit, which is now done by directly calling into the code shared by the normal query implementations.