-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Mark span parent in def_collector. #127241
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
base: master
Are you sure you want to change the base?
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Mark span parent in def_collector. The current device of marking spans with a parent def-id during lowering has been frustrating me for quite some time, as it's very easy to forget marking some spans. This PR moves such marking to the def_collector, which is responsible for creating def-ids on partially expanded AST. This is much more robust as long as visitors are exhaustive. r? ghost
This comment has been minimized.
This comment has been minimized.
95dc7f7
to
585fe45
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Mark span parent in def_collector. The current device of marking spans with a parent def-id during lowering has been frustrating me for quite some time, as it's very easy to forget marking some spans. This PR moves such marking to the def_collector, which is responsible for creating def-ids on partially expanded AST. This is much more robust as long as visitors are exhaustive. r? ghost
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (04122fb): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 0.3%, secondary -0.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 0.6%, secondary 3.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.2%, secondary -0.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 695.108s -> 697.834s (0.39%) |
), | ||
span: p.segments[..proj_start] | ||
.last() | ||
.map_or(path_span_lo, |segment| path_span_lo.to(segment.span())), |
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.
It would appear that half the regression in incr-unchecked comes from Span::to
in this line. The other half comes from using a MutVisitor in DefCollector, which had to be expected.
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.
The other half comes from using a MutVisitor in DefCollector
I tried to address this in #127371, not sure if it will help.
This comment has been minimized.
This comment has been minimized.
@petrochenkov do I need to add something to this PR to handle metavar spans, or is this pass enough? |
9b82411
to
928d08d
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…enkov Complete rustc_ast::mut_visit for spans. Extracted from rust-lang#127241 r? `@petrochenkov`
Complete rustc_ast::mut_visit for spans. Extracted from rust-lang/rust#127241 r? `@petrochenkov`
9159cc6
to
c5fcc64
Compare
c5fcc64
to
2789588
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Mark span parent in def_collector. The current device of marking spans with a parent def-id during lowering has been frustrating me for quite some time, as it's very easy to forget marking some spans. This PR moves such marking to the def_collector, which is responsible for creating def-ids on partially expanded AST. This is much more robust as long as visitors are exhaustive. r? ghost
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (327a748): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.6%, secondary -2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.9%, secondary 3.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 462.57s -> 465.918s (0.72%) |
2789588
to
8447e21
Compare
☔ The latest upstream changes (presumably #144145) made this pull request unmergeable. Please resolve the merge conflicts. |
8447e21
to
50852d9
Compare
I'm only getting your point now. As the parser does not have
Solution 1 seems like reimplementing a lot of code. For now, expansions are probably too unstable due to hashing spans. What did you have in mind? |
50852d9
to
c5e1aca
Compare
The current device of marking spans with a parent def-id during lowering has been frustrating me for quite some time, as it's very easy to forget marking some spans.
This PR moves such marking to the def_collector, which is responsible for creating def-ids on partially expanded AST. This is much more robust as long as visitors are exhaustive.
r? ghost