perf: skip span hashing in non-incremental builds#159796
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
perf: skip span hashing in non-incremental builds
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (f2d657e): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.4%, secondary -3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -3.9%, secondary -4.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 486.272s -> 487.245s (0.20%) |
| // code moving around; otherwise skip them and their source map lookups. | ||
| // Spans are also skipped if `-Z incremental-ignore-spans` is set. | ||
| let hash_spans_initial = (sess.opts.incremental.is_some() || sess.instrument_coverage()) | ||
| && !sess.opts.unstable_opts.incremental_ignore_spans; |
There was a problem hiding this comment.
with_stable_hashing_context is also used in the legacy symbol mangling, for type id hashes and most importantly the crate hash which should depend on all compiler inputs that could potentially affect the output, which includes spans.
8ea1e4e to
f38bdb4
Compare
Span stable-hashing only matters when the hashes outlive the session, i.e. for incremental fingerprints and coverage source hashes. This PR changes it to be off otherwise, which leads to ~2% fewer instructions on non-incr full builds.