Skip to content
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

Revert "Disable preserving mtimes on archives" #7935

Merged
merged 1 commit into from
Mar 14, 2020

Conversation

cwndrws
Copy link
Contributor

@cwndrws cwndrws commented Feb 26, 2020

This reverts commit 8c92e88.

Fixes #7590

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 26, 2020
@alexcrichton
Copy link
Member

The technical bits look good to me here, but I agree with @ehuss on the request for performance numbers if we can

@cwndrws cwndrws force-pushed the revert-removal-of-mtime-preservation branch from e07687d to 25b90e7 Compare March 5, 2020 12:32
@cwndrws
Copy link
Contributor Author

cwndrws commented Mar 5, 2020

To roughly test performance, I'm running cargo fetch on the Warp project on a Windows 10 machine on the spinning disk in that machine. I'm going to run it on cargo built from master and cargo built from my branch, both with the --release flag. I will delete the $CARGO_HOME/registry directory between runs.

Cargo release build off of master (no mtime calls):

D:\src\warp [master ≡]> rm -force $HOME/.cargo/registry

Confirm
The item at C:\Users\charl\.cargo\registry has children and the Recurse parameter was not specified. If you
continue, all children will be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
D:\src\warp [master ≡]> Measure-Command { ..\cargo\target\release\cargo.exe fetch }
    Updating crates.io index
  ... # removed crate download output for brevity
  Downloaded 127 crates (16.2 MB) in 1m 07s (largest was `ring` at 5.3 MB)


Days              : 0
Hours             : 0
Minutes           : 1
Seconds           : 10
Milliseconds      : 231
Ticks             : 702314651
TotalDays         : 0.000812864179398148
TotalHours        : 0.0195087403055556
TotalMinutes      : 1.17052441833333
TotalSeconds      : 70.2314651
TotalMilliseconds : 70231.4651

Cargo release build off of my branch (with mtime calls):

D:\src\warp [master ≡]> rm -force $HOME/.cargo/registry

Confirm
The item at C:\Users\charl\.cargo\registry has children and the Recurse parameter was not specified. If you continue,
all children will be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
D:\src\warp [master ≡]> Measure-Command { ..\cargo\target\release\cargo.exe fetch }
    Updating crates.io index
  ... # removed crate download output for brevity
  Downloaded 172 crates (20.0 MB) in 1m 05s (largest was `ring` at 5.3 MB)


Days              : 0
Hours             : 0
Minutes           : 1
Seconds           : 19
Milliseconds      : 569
Ticks             : 795694809
TotalDays         : 0.000920943065972222
TotalHours        : 0.0221026335833333
TotalMinutes      : 1.326158015
TotalSeconds      : 79.5694809
TotalMilliseconds : 79569.4809

So in this quick an dirty test it seems like performance on this one project got about 13% worse. I'm not sure what is tolerable for this sort of thing, so I'll leave that up to discussion. Let me know if you want me to test on any other systems.

@pnkfelix
Copy link
Member

pnkfelix commented Mar 6, 2020

To me, the 13% performance loss is strong evidence that we should add some way to let users opt into the mtime-lossy system.

  • Update: that is, add an opt-in for the users, or figure out a way to let individual crates opt into mtime preservation. But the latter is not as trivial as one might hope.

But the 13% performance loss does not serve as evidence that we should continue to make the mtime-lossy behavior the default, given that we have crate authors stating that their bulld scripts are relying on mtime preservations.

@ehuss
Copy link
Contributor

ehuss commented Mar 14, 2020

The Cargo team briefly discussed this, and I've been doing some more testing. Since this only affects downloading new crates, generally the performance hit is lost in the noise. Although we still contend that relying on mtime in a build script is a bad idea, it doesn't seem important enough to stop people from trying.

On SSD setups, the "extraction" phase barely registers in my testing. However, on my desktop machine with a magnetic HD, I see it taking a huge amount of time (a cargo fetch that normally takes 30s takes 80s on the HD). Whether or not mtime is preserved doesn't really impact the total time. Lesson here is to use an SSD. 😉

If we really want to improve extraction time, one option is to make extraction run in parallel with downloading. I tried to implement this a couple years ago, but it is very difficult due to the way Cargo's download system works. I'm uncertain if refactoring all that code would be justified since it is already pretty tricky.

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 14, 2020

📌 Commit 25b90e7 has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 14, 2020
@bors
Copy link
Collaborator

bors commented Mar 14, 2020

⌛ Testing commit 25b90e7 with merge 94093c2...

@bors
Copy link
Collaborator

bors commented Mar 14, 2020

☀️ Test successful - checks-azure
Approved by: ehuss
Pushing 94093c2 to master...

@bors bors merged commit 94093c2 into rust-lang:master Mar 14, 2020
bors added a commit to rust-lang/rust that referenced this pull request Mar 18, 2020
Update cargo

Update cargo

21 commits in bda50510d1daf6e9c53ad6ccf603da6e0fa8103f..7019b3ed3d539db7429d10a343b69be8c426b576
2020-03-02 18:05:34 +0000 to 2020-03-17 21:02:00 +0000
- Run through clippy (rust-lang/cargo#8015)
- Fix config profiles using "dev" in `cargo test`. (rust-lang/cargo#8012)
- Run CI on all PRs. (rust-lang/cargo#8011)
- Add unit-graph JSON output. (rust-lang/cargo#7977)
- Split workspace/validate() into multiple functions (rust-lang/cargo#8008)
- Use Option::as_deref (rust-lang/cargo#8005)
- De-duplicate edges (rust-lang/cargo#7993)
- Revert "Disable preserving mtimes on archives" (rust-lang/cargo#7935)
- Close the front door for clippy but open the back (rust-lang/cargo#7533)
- Fix CHANGELOG.md typos (rust-lang/cargo#7999)
- Update changelog note about crate-versions flag. (rust-lang/cargo#7998)
- Bump to 0.45.0, update changelog (rust-lang/cargo#7997)
- Bump libgit2 dependencies (rust-lang/cargo#7996)
- Avoid buffering large amounts of rustc output. (rust-lang/cargo#7838)
- Add "Updating" status for git submodules. (rust-lang/cargo#7989)
- WorkspaceResolve: Use descriptive lifetime label. (rust-lang/cargo#7990)
- Support old html anchors in manifest chapter. (rust-lang/cargo#7983)
- Don't create hardlink for library test and integrations tests, fixing rust-lang/cargo#7960 (rust-lang/cargo#7965)
- Partially revert change to filter debug_assertions. (rust-lang/cargo#7970)
- Try to better handle restricted crate names. (rust-lang/cargo#7959)
- Fix bug with new feature resolver and required-features. (rust-lang/cargo#7962)
@ehuss ehuss added this to the 1.44.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider preserving mtimes of archives
6 participants