-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Remove unwraps from metadata decoding: introduce BlobDecoder
#149455
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
Conversation
|
These commits modify compiler targets. |
25b88c6 to
cf9344a
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
cc: @oli-obk this is what I was talking about. not yet clean, but wanted to see what perf looked like :3 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 694a8a4 failed: CI. Failed jobs:
|
cf9344a to
bed17cf
Compare
|
@bors try |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (7ac6e1b): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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. @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)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 471.041s -> 471.157s (0.02%) |
|
The large workspace benchmark shows improvements in not just instructions, but also time on the write dep info query. Everything else is a mixed bag on time, unsure why other queries are affected. There are minimal improvements for incremental loading across the board. I'm guessing I'm general the branch predictor just got this all correct. |
524ba79 to
285c9b1
Compare
| fn decoder(self, pos: usize) -> Self::Context; | ||
| } | ||
|
|
||
| impl<'a> Metadata<'a> for &'a MetadataBlob { |
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.
importantly there are now only two, not 5 implementations of Metadata.
- One for
MetadataBlobwhich provides only theBlobDecodeContextwhich only implementsBlobDecoder - One for
(tcx, cdata)which provides theMetadataDecodeContextwhich does implementSpanDecoderandTyDecoder.
This makes it statically known whether we have tcx and cdata available, and whether spans etc can be decoded or not.
| fn decode<'a, 'tcx, M: Metadata<'a>>(self, metadata: M) -> T::Value<'tcx> | ||
| where | ||
| T::Value<'tcx>: Decodable<DecodeContext<'a, 'tcx>>, | ||
| T::Value<'tcx>: Decodable<M::Context>, |
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.
Decodable specifically with the Context type from whichever kind of M: Metadata is given.
| impl<'a, 'tcx> MetadataDecodeContext<'a, 'tcx> { | ||
| #[inline] | ||
| fn tcx(&self) -> TyCtxt<'tcx> { | ||
| let Some(tcx) = self.tcx else { |
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.
unwrap removed
| if let Some(alloc_decoding_session) = self.alloc_decoding_session { | ||
| alloc_decoding_session.decode_alloc_id(self) | ||
| } else { | ||
| bug!("Attempting to decode interpret::AllocId without CrateMetadata") |
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.
unwrap removed
| let cdata = self.cdata(); | ||
|
|
||
| let Some(sess) = self.sess else { | ||
| bug!( |
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.
unwrap removed
BlobDecoder
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.
doc nits
|
Reminder, once the PR becomes ready for a review, use |
ca97283 to
8c7889b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 03d7ad7 (parent) -> 5bc3450 (this PR) Test differencesShow 3 test diffs3 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 5bc345055b06dc096b01bc6d1e0cbe92d3cc630e --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (5bc3450): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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.8%, secondary -2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.2%, secondary -1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 472.922s -> 473.701s (0.16%) |
r? @oli-obk