Repository navigation
Deduplicate DefId encodings in the query cache - #164300
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Deduplicate DefId encodings in the query cache
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (381214b): comparison URL. Overall result: ❌ regressions - please read:Benchmarking 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. Next, please: If you can, justify the regressions found in this try perf run in writing along with @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 -1.7%, secondary -4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 487.613s -> 488.634s (0.21%) |
|
Nice wins there. I tried building (
So about a 2% (~25 MiB) reduction here, for a clean incremental build. |
|
r? @beetrees rustbot has assigned @beetrees. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Most of the icount increase in 30,275,316 (100.0%) PROGRAM TOTALS
--------------------------------------------------------------------------------
-- File:function summary
--------------------------------------------------------------------------------
Ir________________________ file:function
< 29,982,329 (99.0%, 99.0%) ???:
11,173,357 (36.9%) <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_span::SpanEncoder>::encode_span
9,874,207 (32.6%) <rustc_middle::query::on_disk_cache::CacheDecoder as rustc_span::SpanDecoder>::decode_span
3,952,030 (13.1%) <rustc_middle::query::on_disk_cache::CacheDecoder as rustc_span::SpanDecoder>::decode_def_id
3,616,469 (11.9%) <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_span::SpanEncoder>::encode_def_id
1,228,968 (4.1%) <rustc_middle::mir::syntax::Operand as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
-867,459 (-2.9%) <rustc_middle::mir::syntax::Place as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
-861,145 (-2.8%) <alloc::vec::Vec<rustc_span::Spanned<rustc_middle::mir::syntax::Operand>> as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
836,200 (2.8%) <rustc_middle::query::on_disk_cache::CacheDecoder as rustc_span::BlobDecoder>::decode_local_def_id
704,292 (2.3%) rustc_query_impl::incremental::encode_query_values_inner::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>, &rustc_middle::ty::generics::Generics>::{closure#0}
567,527 (1.9%) <hashbrown::raw::RawTable<(rustc_middle::ty::Ty, usize)>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_middle::ty::Ty, usize, rustc_hash::FxBuildHasher>::{closure#0}>
-537,260 (-1.8%) <rustc_stable_hash::sip128::SipHasher128>::finish128_inner |
|
@panstromek SpanData contains a parent |
|
@bors r+ |
|
@bors rollup=iffy |
…r=beetrees Deduplicate DefId encodings in the query cache I used a similar approach for DefId encoding and decoding, based on the existing Symbol encoder and decoder. https://github.com/rust-lang/rust/blob/81900216ce9ee0b48f2c563c696bfca98cfba755/compiler/rustc_middle/src/query/on_disk_cache.rs#L818 https://github.com/rust-lang/rust/blob/81900216ce9ee0b48f2c563c696bfca98cfba755/compiler/rustc_middle/src/query/on_disk_cache.rs#L447
…uwer Rollup of 4 perf-sensitive pull requests Successful merges: - #163845 (Add various `#[inline]` annotations for simple functions on hot paths that don't get inlined) - #164122 (Don't emit allow attributes in try/contract desugaring) - #164260 (create fast path for attributes created in builtin macro expansions) - #164300 (Deduplicate DefId encodings in the query cache) Failed merges: - #164790 (Split `LintLevelsBuilder::add` into `add_ast` and `add_hir`)
…uwer Rollup of 4 perf-sensitive pull requests Successful merges: - #163845 (Add various `#[inline]` annotations for simple functions on hot paths that don't get inlined) - #164122 (Don't emit allow attributes in try/contract desugaring) - #164260 (create fast path for attributes created in builtin macro expansions) - #164300 (Deduplicate DefId encodings in the query cache) Failed merges: - #164790 (Split `LintLevelsBuilder::add` into `add_ast` and `add_hir`)
…uwer Rollup of 5 pull requests Successful merges: - #163845 (Add various `#[inline]` annotations for simple functions on hot paths that don't get inlined) - #164122 (Don't emit allow attributes in try/contract desugaring) - #164260 (create fast path for attributes created in builtin macro expansions) - #164300 (Deduplicate DefId encodings in the query cache) - #164929 (Revert "rustc_codegen_gcc subtree update") Failed merges: - #164790 (Split `LintLevelsBuilder::add` into `add_ast` and `add_hir`)
Rollup merge of #164300 - TaKO8Ki:dedup-query-cache-defids, r=beetrees Deduplicate DefId encodings in the query cache I used a similar approach for DefId encoding and decoding, based on the existing Symbol encoder and decoder. https://github.com/rust-lang/rust/blob/81900216ce9ee0b48f2c563c696bfca98cfba755/compiler/rustc_middle/src/query/on_disk_cache.rs#L818 https://github.com/rust-lang/rust/blob/81900216ce9ee0b48f2c563c696bfca98cfba755/compiler/rustc_middle/src/query/on_disk_cache.rs#L447
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (69cf161): comparison URL. Overall result: ❌ regressions - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression 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 -1.1%, secondary -2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.0%, secondary 0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Artifact size: 405.91 MiB -> 405.98 MiB (0.02%) |

I used a similar approach for DefId encoding and decoding, based on the existing Symbol encoder and decoder.
rust/compiler/rustc_middle/src/query/on_disk_cache.rs
Line 818 in 8190021
rust/compiler/rustc_middle/src/query/on_disk_cache.rs
Line 447 in 8190021