rustc_typeck: remove the "preload all impls ever" workaround in coherence.#25323
Merged
bors merged 4 commits intorust-lang:masterfrom May 12, 2015
Merged
rustc_typeck: remove the "preload all impls ever" workaround in coherence.#25323bors merged 4 commits intorust-lang:masterfrom
bors merged 4 commits intorust-lang:masterfrom
Conversation
…ake it clear that it only populates inherent impls.
…rait's impls from all the crates.
Contributor
|
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
@brson Any chance this can make it into 1.0? I don't mind it personally, but I've seen some interest on IRC for having the (minor IMO) compile-time wins here in 1.0. |
Contributor
|
@eddyb, you're my hero 😻 |
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 75cd8f9 has been approved by |
Contributor
|
@bors p=5 |
Contributor
|
(Regarding 1.0, I'm inclined to say the risk/reward here does not pay off; there are other lower risk PR's that also have UX impact that we declined much earlier in beta cycle) |
Contributor
Collaborator
bors
added a commit
that referenced
this pull request
May 12, 2015
The loop to load all the known impls from external crates seems to have been used because `ty::populate_implementations_for_trait_if_necessary` wasn't doing its job, and solely relying on it resulted in loading only impls in the same crate as the trait.
Coherence for `librustc` was reduced from 18.310s to 0.610s, from stage1 to stage2.
Interestingly, type checking also went from 46.232s to 42.003s, though that could be noise or unrelated improvements.
On a smaller scale, `fn main() {}` now spends 0.003s in coherence instead of 0.368s, which fixes #22068.
It also peaks at only 1.2MB, instead of 16MB of heap usage.
Contributor
|
Without reading too closely, this looks great to me, and I agree with @pnkfelix's assessment that this is not a good candidate for backporting. |
Collaborator
Contributor
|
Nice, those are some serious speedups! Looks like 1.1 will already improve compile speed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The loop to load all the known impls from external crates seems to have been used because
ty::populate_implementations_for_trait_if_necessarywasn't doing its job, and solely relying on it resulted in loading only impls in the same crate as the trait.Coherence for
librustcwas reduced from 18.310s to 0.610s, from stage1 to stage2.Interestingly, type checking also went from 46.232s to 42.003s, though that could be noise or unrelated improvements.
On a smaller scale,
fn main() {}now spends 0.003s in coherence instead of 0.368s, which fixes #22068.It also peaks at only 1.2MB, instead of 16MB of heap usage.