You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like sometimes rustc --print sysroot can take as long as three seconds to complete. I think this a bit too much, and I suppose that rustup is to blame. See intellij-rust/intellij-rust#754 (comment) for example of this issue. We've raised timeout to five seconds in IntelliJ Rust, so this shouldn't be a problem, but it seems fishy anyway!
Many thanks to @la10736 for investigating this issue!
This only happens on the first execution of rustup, so it's likely related to disk access which is then being cached for later executions. While I can't reproduce it taking 3 seconds to run, it is noticeably slower on that first run.
These are the minimum steps that need to happen:
rustc rustup proxy is run
rustup checks for legacy versions, and loads configuration file
rustup determines current toolchain by checking environment variables and looking for overrides for the current directory
actual rustc is run
There are a few factors that might contribute to slowness, not all of which can be improved easily:
Loading rustup, rustc and configuration files from disk the first time
ELF loader (needs to load two un-cached binaries instead of one)
Rustup may be doing additional work not strictly required to just proxy the command
Hopefully it's the last one, in which case it should be fairly easy to track down with strace.
@la10736 this sounds fishy! Could you try passing -f to strace to follow child processes as well? That should help capture the output of the real compiler as well (I think)
Activity
matklad commentedon Oct 25, 2016
Not that
sysrootis not important here, the invalidrustc --print systemalso takes a lot of time.Diggsey commentedon Oct 25, 2016
This only happens on the first execution of rustup, so it's likely related to disk access which is then being cached for later executions. While I can't reproduce it taking 3 seconds to run, it is noticeably slower on that first run.
These are the minimum steps that need to happen:
rustcrustup proxy is runrustcis runThere are a few factors that might contribute to slowness, not all of which can be improved easily:
Hopefully it's the last one, in which case it should be fairly easy to track down with
strace.la10736 commentedon Oct 25, 2016
Ok I did a
strace -rTC:After you can find all command's output but from what I can understand just follow two lines mater:
What it really mean is over my understanding... 😄
All Output
Diggsey commentedon Oct 25, 2016
That would seem to indicate that the real
rustcis just taking a long time to execute the first time?la10736 commentedon Oct 25, 2016
How can I check it?
alexcrichton commentedon Oct 25, 2016
@la10736 this sounds fishy! Could you try passing
-ftostraceto follow child processes as well? That should help capture the output of the real compiler as well (I think)la10736 commentedon Oct 26, 2016
@alexcrichton : I did it
Another strange thing is that the execution time go from 1.5 to 4.5 seconds (every time I did it after a reboot).
Merge #8624