Only honor -Zincremental-verify-ich for incremental compiles - #159796
Only honor -Zincremental-verify-ich for incremental compiles#159796xmakro wants to merge 1 commit into
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.
There was a problem hiding this comment.
Thanks! I think get_symbol_hash and type_id_hash already hash with spans disabled, but I missed the crate hash which needs the spans. I'll follow #94878 (crate hash from the encoded metadata) first and might revisit this afterwards.
I reduced this PR now to just the -Zincremental-verify-ich change, which turned out to be a good part of the perf win, but is misleading because it is a perf artifact, see rust-lang/rustc-perf#2510
8ea1e4e to
f38bdb4
Compare
f38bdb4 to
50822b9
Compare
50822b9 to
a142fcf
Compare
a142fcf to
44f0297
Compare
44f0297 to
b4df581
Compare
b4df581 to
6d48454
Compare
|
r? @Zalathar |
|
|
For non-incremental compiles the flag has no purpose. It triggers a query key verification sweep that costs ~1.3% of instructions on non-incr full measurements. This is overhead that exists only in the benchmark, not in real builds.