-
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
High CPU usage when cargo updates its index #9215
Comments
Sorry for not replying. Has this resolved itself, or do we have a way to reproduce it? |
Yes, still the same. Actually, I checked more carefully:
Tested now with cargo 1.52.0 (6976741 2021-04-21), on macOS 10.14.6 EDIT: it's 100% but on a single thread (there are others software that run well using the other cores at the same time, so it's not crushing the computer like the parallel compilation that comes afterward :)) |
Can you run a profiler on it when it is using a full cpu, and get some info on what it is doing and where it is spending its time? |
How shall I do that? I've now real knowledge in performance profiling Rust apps, however I can easily execute commands :) I installed Instruments and did the following:
The trace contains the following tracks:
Once I saved and compressed the track to share it, I have a 103 MB file. Should I send it somehow? Do you think you have the relevant data for investigating the issue? |
I do not use Mac myself. @ehuss Would that file be worth looking at, or do you have advice for a next research step? |
Here's the instructions on how to run instruments:
Here's a picture of what mine looks like: On mine, almost all of the high CPU time (about 9.5 seconds) is spent in sha1 and inflate. |
Out of curiousity, I tried a build using OpenSSL SHA1 instead of the custom collision-detection SHA1, and it had a pretty dramatic performance improvement (went from about 8s to 5s). I also noticed that zlib-ng was fair bit faster, too, though not as dramatic. |
Problem
I used the command
cargo install cross
, and while downloading the crates index (few minutes), my CPU fan started making noise. After checking, a CPU code was at 100% usage.Steps
cargo install cross
(any anything that acually updated the index)Possible Solution(s)
Maybe the display is updated each time a chunk of data is received, which triggers a lot of updates for a long time, in case the network connection is slow.
Notes
Output of
cargo version
, running on macOS 10.14.6:The text was updated successfully, but these errors were encountered: