-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[perf] don't use temporary files for archive builder #104191
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit eb0cba5437deeb68fc44c60b6df85fbfc219ad7e with merge 2a3475da1922519835b37aa7d28bfc574e55f09d... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2a3475da1922519835b37aa7d28bfc574e55f09d): comparison URL. Overall result: no relevant changes - no 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
There doesn't seem to be much task clock or wall time change in either direction, but it shows a clear regression in max-rss. I think having a way to stream archive files directly to the disk while building them would work better. This is not something that LLVM supports though and it is non-trivial for every variant of the ar archive format due to the presence of the symbol table (and for the gnu variant a member name table for long names) that needs to be at the start of the file. For lld the symbol table is optional since recently as it was found to not provide a perf benefit for lld, but most other linkers still mandate it's presence. |
I don't understand why it happens. |
@@ -24,6 +24,8 @@ use rustc_session::Session; | |||
pub struct LlvmArchiveBuilder<'a> { | |||
sess: &'a Session, | |||
additions: Vec<Addition>, | |||
|
|||
buffers: Vec<(String, Vec<u8>)>, |
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.
If this PR goes towards merging, then this is better added as a new variant to enum Addition
instead of a separate vector.
r? @bjorn3 |
Mmap only counts towards max-rss when being paged in afaik. In addition the os is free to page it out even when no swap memory exists as it can be loaded from the original file again. This last point is important as without we did likely hit an OOM condition a lot more on systems with little memory. |
This was run on CI with SSD\NVMe drives (probably), maybe running it on HDD will show the diff. |
eb0cba5
to
8b66395
Compare
☔ The latest upstream changes (presumably #97485) made this pull request unmergeable. Please resolve the merge conflicts. |
@belovdv any updates on this? |
I couldn't find clear benefits from this change (please, correct me if it's wrong). |
This is a draft - for perf testing only.
r? @petrochenkov