Skip to content

A large chunk of time is spent in phase_4_translate_to_llvm during cargo check #3444

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

Closed
jrmuizel opened this issue Dec 22, 2016 · 9 comments
Closed

Comments

@jrmuizel
Copy link

jrmuizel commented Dec 22, 2016

I was profiling 'cargo check' and it looks like about 53% of the time is spent in phase_4_translate_to_llvm. Is it really necessary to translate_to_llvm during check?

@nrc

@nrc
Copy link
Member

nrc commented Dec 22, 2016

This should not be the case (caveat below). Kinda the whole point of cargo check is skipping llvm and trans phases. I should double check that we do in fact skip trans and not just llvm, but I'm pretty sure we should. The exception is if there are procedural macros, these must be compiled because they are executed at compile time, but it would be an odd project that spent 53% of time doing that.

I'll look into this...

@jrmuizel
Copy link
Author

I was profiling cargo check on https://github.com/servo/webrender/tree/master/wrench

@alexcrichton
Copy link
Member

I think this may be a duplicate of #3418?

@nrc
Copy link
Member

nrc commented Jan 10, 2017

This should be fixed now.

@jrmuizel
Copy link
Author

Should the fix be in rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)? Because I'm still seeing the bulk of the time in 44% of time in rustc_driver::driver::phase_4_translate_to_llvm

@alexcrichton
Copy link
Member

@jrmuizel cargo check still generates code for build scripts and such. Out of the 131 invocations of rustc in the wrench directory 77 of them emit metadata, which means that 54 crates are still compiled. Beyond that though I think this bug is fixed, so closing.

@jrmuizel
Copy link
Author

I was only profiling the final rustc --crate-name wrench main.rs --crate-type bin --emit=dep-info,metadata invocation so this should be unrelated to build scripts.

@alexcrichton
Copy link
Member

Ah ok. In that case though this is likely an upstream rustc bug rather than a Cargo bug, as Cargo's just shelling out to rustc with appropriate arguments.

@jrmuizel
Copy link
Author

Indeed. I've filed rust-lang/rust#38964.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants