-
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
Let a portion of DefPathHash uniquely identify the DefPath's crate. #81635
Let a portion of DefPathHash uniquely identify the DefPath's crate. #81635
Conversation
This comment has been minimized.
This comment has been minimized.
I'll need to take a closer look to see if those changed crate-disambiguators are an expected outcome of this PR. |
The first test failure is expected. Error messages in that lint are sorted by |
The symbol name changes are due to my making I'll update the test cases asap. |
This allows to directly map from a DefPathHash to the crate it originates from, without constructing side tables to do that mapping. It also allows to reliably and cheaply check for DefPathHash collisions.
afdab0e
to
6a4878f
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 6a4878f with merge efd074000fc38c9a79ba7eb808e5d7635211dd2e... |
☀️ Try build successful - checks-actions |
Queued efd074000fc38c9a79ba7eb808e5d7635211dd2e with parent b593389, future comparison URL. |
Finished benchmarking try commit (efd074000fc38c9a79ba7eb808e5d7635211dd2e): 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 |
Mostly slight regressions of up to 0.7% with an 1.8% improvement on deeply-nested-async-check and a few other improvements of up to 0.7%. |
Performance changes look like noise 👍 |
This comment has been minimized.
This comment has been minimized.
cc38448
to
aa41b0a
Compare
This comment has been minimized.
This comment has been minimized.
This PR is cursed. |
⌛ Testing commit 9e50544 with merge d49cde51341d84140f2cc93014d67a02d1f6be5b... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
Don't duplicate the extern providers once for each crate This should give a small perf improvement for small crates by avoiding a memcpy of a pretty big struct for each loaded crate. In addition would be useful for replacing the sequential `CrateNum` everywhere with the hash based `StableCrateId` introduced in rust-lang#81635, which would allow avoiding remapping of `CrateNum`'s when loading crate metadata. While this PR is not strictly needed for that, it is necessary to prevent a performance loss due to it. I think this duplication was done in rust-lang#40008 (which introduced the query system) to make it possible to compile multiple crates in a single session in the future. I think this is unlikely to be implemented any time soon. In addition this PR can easily be reverted if necessary to implement this.
This allows to directly map from a
DefPathHash
to the crate it originates from, without constructing side tables to do that mapping -- something that is useful for incremental compilation where we deal withDefPathHash
instead ofDefId
a lot.It also allows to reliably and cheaply check for
DefPathHash
collisions which allows the compiler to gracefully abort compilation instead of running into a subsequent ICE at some random place in the code.The following new piece of documentation describes the most interesting aspects of the changes:
Given the probabilities involved I hope that no one will ever actually see the error messages. Nonetheless, I'd be glad about some feedback on how to improve them. Should we create a GH issue describing the problem and possible solutions to point to? Or a page in the rustc book?
r? @pnkfelix (feel free to re-assign)