-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc: remove type & lifetime parameter names from the typesystem. #53661
Conversation
@bors try (for perf) |
⌛ Trying commit a4ede7fbf81ccf0e3685c4b1926c2376f90b81f2 with merge bc159c404dc86f12fe6e0315841c8694ed5fa2ca... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This should be a big improvement for #49300 ❤️ |
☀️ Test successful - status-travis |
@rust-timer build bc159c404dc86f12fe6e0315841c8694ed5fa2ca |
Success: Queued bc159c404dc86f12fe6e0315841c8694ed5fa2ca with parent 63d6649, comparison URL. |
Perf results are ready |
@nikomatsakis @michaelwoerister I was worried about this (perf results are pretty bad). First of all, querying Secondly, why would names of generic parameters be needed outside error messages? EDIT: looking at uses of |
rustc: remove Ty::{is_self, has_self_ty}. Fixes #50125 by replacing special-casing of `Self` (and the gensym hack) with getting the type for the `Self` parameter from the trait, and comparing types with that, instead. **NOTE**: this is part of #53661, split out to independently check performance impact.
So, by using #53677, I was able to determine that the commits after the first two look roughly neutral, whereas the first two commits themselves contain most, if not all, of the regression. So it's really having the |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Interesting. As you know, I sort of want to have only indices anyway, but still, I'm a bit surprised to see the impact as large as it is, given that we already have names. I guess we only use a relative small set of names? |
☔ The latest upstream changes (presumably #53441) made this pull request unmergeable. Please resolve the merge conflicts. |
Looking at the first two commits, nothing jumps out immediately as being slow. Since the slowdown in serde is so visible, running things in a profiler might give a good indications where the slowdown comes from. |
Ping from triage @eddyb: What are your plans for this PR? |
@TimNN I'm not sure. Maybe if @michaelwoerister or @nnethercote can help me profile it, and we end up finding a problem somewhere else that's causing the slowdown, that'd be great? |
@eddyb: https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector has recently-improved docs on benchmarking and profiling. If you can use Cachegrind, that's probably best because you can get diffs between two different profiles, which is very useful for understanding regressions. |
That's a shame, I like Callgrind. Anyway, I might have a go at this, but not any time soon, due to time constraints on the edition. |
Ping from triage @eddyb: What is the status of this PR? |
Ping from triage @eddyb: Since we haven't heard from you on this PR in a while and since you stated yourself that you won't have time to work on this PR in the near future I'm closing this as inactive for the moment, in line with our triage guidelines. Please re-open in the future and thanks for all your work on |
@nikomatsakis Did you have a concrete plan for something like |
Everything that needs a name, for whatever reason, must get it from the
DefId
.Fixes #50125 by replacing special-casing of
Self
(and the gensym hack) with getting the type for theSelf
parameter from the trait, and comparing types with that, instead.Also removes AST pretty-printing for input position
impl Trait
, it now prints like-> impl Trait
.That is, the relevant
ty::Predicate
s are obtained on the fly from the definition and printed.r? @nikomatsakis cc @michaelwoerister @varkor @oli-obk @GuillaumeGomez