-
Notifications
You must be signed in to change notification settings - Fork 601
Calculate rustc outputs concurrently with other hashing tasks #2465
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
base: main
Are you sure you want to change the base?
Conversation
Currently, `sccache` invokes `rustc` twice for generating the hash key: once for the inputs and env-deps (`--emit dep-info`), and another time for the output file names (`--print file-names`). However, the latter is invoked only after the former finishes. There is no reason for this dependency. Run `get_compiler_outputs` concurrently with the other `rustc` and hashing tasks in `RustHasher::generate_hash_key`. I initially thought that these two invocations could be merged together, but `--print` stop compilation before the `--emit` is evaluated, so I went with the simpler approach of just running them at the same time.
9f98505 to
6654b9a
Compare
|
nice Thanks |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2465 +/- ##
=======================================
Coverage 71.22% 71.22%
=======================================
Files 64 64
Lines 35221 35224 +3
=======================================
+ Hits 25087 25090 +3
Misses 10134 10134 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm not sure how best to add a test here since the behavior is the exact same
I measured the time reported by the Looks about ~5-10ms faster per each However, I couldn't notice a difference in the final walltime of a |
Currently,
sccacheinvokesrustctwice for generating the hash key: once for the inputs and env-deps (--emit dep-info), and another time for the output file names (--print file-names).However, the latter is invoked only after the former finishes. There is no reason for this dependency.
Run
get_compiler_outputsconcurrently with the otherrustcand hashing tasks inRustHasher::generate_hash_key.I initially thought that these two invocations could be merged together, but
--printstop compilation before the--emitis evaluated, so I went with the simpler approach of just running them at the same time.