-
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
speed up x install
by skipping archiving and compression
#118724
Conversation
Right now I am on a low-resource machine and can't perform benchmarks between current-new way of |
1d5e932
to
089ca10
Compare
Propagating My suspicion is that producing the tarball and unpacking it is basically free, at least on most systems, it's the compression & decompression that hurts (particularly with gzip or xz, neither of which are fast on either operation). Adding a no-op compression format should be much cheaper in lines of code and added maintenance complexity, so it's my preferred approach even if the tarballing is slightly more expensive than nothing. |
089ca10
to
4156818
Compare
System specs:
Configuration: change-id = 116881
profile = "dist"
[llvm]
download-ci-llvm = true
[build]
submodules = true
extended = true
[rust]
download-rustc = false
deny-warnings = false |
What about the current approach (91b56e4) ? This shouldn't add any complexity on bootstrap I believe. |
The current in-PR approach is significantly better, but it still introduces more modality than I'd like. It also means if we do want plain tarballs (e.g., to compress out of band, or not compress at all), we'd need an extra mode. It also still adds complexity in the form of the unwrap()s added in various places that want a tarball. |
In that case yes, we need another mode. I don't have strong feelings, but I don't understand how worth it is to generate tarballs under "build/dist" when we can simply avoid doing that altogether. Currently, bootstrap handles 'install' with the following logic:
With this PR: So, anything between 'prepare' and 'use the prepared directory' is a redundant operation for the actual functionality of From a performance perspective, I think there won't be much difference (if the disk is not too slow), but I'm not sure about the disk usage (for plain tarballs), maybe I should check that too. |
Yeah, I understand that anything beyond the current state makes the operation slower. The amount of usage of install should be very small though, only users building from source explicitly to install go through that path. Almost everyone is using rustup (or other package managers) that handle this behind the scenes. But we need to thread the tradeoff between adding complexity and extra state to consider as we evolve, possible improved speed with more granular options, and impact of that speed on users. IMO, the tradeoff in this case makes me want to do minimum addition - i.e., supporting a no-op compression format - since that's somewhere we already have complexity (gz vs xz, and I think various profiles within those), so an extra variant is a cheap price to pay, and nothing except the compression code should need to care. |
@onur-ozkan any updates on this? thanks |
Soon I will work on it again. |
4156818
to
5a574b2
Compare
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
5a574b2
to
a13ec8d
Compare
Functionality remains identical, but now there is no added complexity on bootstrap and it is solely controlled with the new compression format "no-op" added for @rustbot ready |
Thanks, this looks good to me. @bors r+ |
🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (26cd5d8): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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)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.
CyclesResultsThis 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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 649.797s -> 651.624s (0.28%) |
speed up `x install` by skipping archiving and compression Performing archiving and compression on `x install` is nothing more than a waste of time and resources. Additionally, for systems like gentoo(which uses `x install`) this should be highly beneficial. [benchmark report](rust-lang/rust#118724 (comment)) Resolves #109308 r? Mark-Simulacrum (I think you want to review this, feel free to change it if otherwise.)
speed up `x install` by skipping archiving and compression Performing archiving and compression on `x install` is nothing more than a waste of time and resources. Additionally, for systems like gentoo(which uses `x install`) this should be highly beneficial. [benchmark report](rust-lang/rust#118724 (comment)) Resolves #109308 r? Mark-Simulacrum (I think you want to review this, feel free to change it if otherwise.)
speed up `x install` by skipping archiving and compression Performing archiving and compression on `x install` is nothing more than a waste of time and resources. Additionally, for systems like gentoo(which uses `x install`) this should be highly beneficial. [benchmark report](rust-lang/rust#118724 (comment)) Resolves #109308 r? Mark-Simulacrum (I think you want to review this, feel free to change it if otherwise.)
Performing archiving and compression on
x install
is nothing more than a waste of time and resources. Additionally, for systems like gentoo(which usesx install
) this should be highly beneficial.benchmark report
Resolves #109308
r? Mark-Simulacrum (I think you want to review this, feel free to change it if otherwise.)