-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Lazily decode SourceFile from metadata #100209
Conversation
dcb042e
to
16ba778
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 16ba778 with merge 7727698a1761dc5ff29971bb098c1fd11cd70852... |
☀️ Try build successful - checks-actions |
Queued 7727698a1761dc5ff29971bb098c1fd11cd70852 with parent 44bd81d, future comparison URL. |
Finished benchmarking commit (7727698a1761dc5ff29971bb098c1fd11cd70852): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 Footnotes |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit bacb4db with merge 72ee1407cb57fa4b7a2ca9feaae9cb0d325a0279... |
☀️ Try build successful - checks-actions |
Queued 72ee1407cb57fa4b7a2ca9feaae9cb0d325a0279 with parent 5651759, future comparison URL. |
Finished benchmarking commit (72ee1407cb57fa4b7a2ca9feaae9cb0d325a0279): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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. @bors rollup=never Footnotes |
r? compiler |
required_source_files: Option<GrowableBitSet<usize>>, | ||
// `SourceFile` into the `FxIndexSet`. | ||
// The order inside the `FxIndexSet` is used as on-disk | ||
// order of `SourceFiles`, and encoded inside `Span`s. |
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.
Is it worth making this order sensitive like that? I could imagine some kind of poor effects on deterministic metadata contents -- maybe we can emit in order or even sorted by (remapped) file path?
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 order of the SourceFile
s here should be exactly the order in which spans are encoded. Therefore, a change in this order can only be caused by a change in encoded spans. As we can't really know which SourceFile
s we will need in the end, I don't see how we can pre-sort them.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (468887e): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Potentially relevant reddit thread: https://www.reddit.com/r/rust/comments/wt5vr9/compile_time_wins_today/ |
This changes encoding for |
@klensy no. metadata and incremental cache have different formats, on purpose. |
Currently, source files from foreign crates are decoded up-front from metadata.
Spans from those crates were matched with the corresponding source using binary search among those files.
This PR changes the strategy by matching spans to files during encoding. This allows to decode source files on-demand, instead of up-front. The on-disk format for spans becomes:
<tag> <position from start of file> <length> <file index> <crate (if foreign file)>
.