-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Performance Regression in cargo package
on 1.81.0
#14955
Comments
The dirty check specifically checks for whether any files being packaged are dirty which makes at least part of this a per-package operation. However, may parts could be skipped or moved earlier, depending on where the slow down is. |
#13960 is the culprit of this regression. We do |
Going to do a refactor on moving this out from the package loop. @rustbot claims |
### What does this PR try to resolve? This helps debug <#14955>. ### How should we test and review this PR? While `check_repo_state` is the culprit, let's add some traces for future. ### Additional information
Did some profiling. Detailed report in #14962. To summarize, we were doing Here are profiling data: trace.tar.gz On 59b2ddd (trace-offline.json)#14962 (trace-offline-pathspec.json) |
If we skipped the entire git status check (the |
Problem
The aws-sdk-rust recently updated our MSRV to
1.81.0
. This caused a 3-4x slowdown in ourcargo package
invocation. We traced the likely culprit of this slowdown to #13960 which removes anif !opts.allow_dirty
check around thecheck_repo_state
function causing it to run on ever packaging step.This causes a problem with the aws-sdk-rust repo. Since it is very large and has a huge history all invocations to
git
in that repository are slow. Sincecargo package
is now invokinggit
on every packaging step in the workspace it slows the whole process down to a crawl.Steps
git clone https://github.com/awslabs/aws-sdk-rust.git
to checkout theaws-sdk-rust
repo (this will be a bit slow, it is huge)<1.81
aws-sdk-rust
repo runcargo package --no-verify --allow-dirty --workspace
observe the approximate pace at which crates are packaged (you can also use thetime
command, but this fails locally for me withToo many open files (os error 24)
before it completes)=1.81
time cargo package --no-verify --allow-dirty --workspace
(this goes too slowly for me to wait for it to fail, but it is very easy to observe the difference in speed)Possible Solution(s)
Potentially when packaging multiple crates it might be possible to only invoke
git
once at the beginning of the run? Or potentially add a new option to disable the behavior introduced in #13960 that always generates a.cargo_vcs_info.json
Notes
No response
Version
The text was updated successfully, but these errors were encountered: