Auto merge of #108300 - oli-obk:elsa, r=eholk
Use a lock-free datastructure for source_span follow up to the perf regression in https://github.com/rust-lang/rust/pull/105462 The main regression is likely the CStore, but let's evaluate the perf impact of this on its own
This commit is contained in:
commit
bd4a96a12d
12 changed files with 79 additions and 36 deletions
|
@ -1030,7 +1030,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
/// system if the result is otherwise tracked through queries
|
||||
#[inline]
|
||||
pub fn source_span_untracked(self, def_id: LocalDefId) -> Span {
|
||||
self.untracked.source_span.read().get(def_id).copied().unwrap_or(DUMMY_SP)
|
||||
self.untracked.source_span.get(def_id).unwrap_or(DUMMY_SP)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
@ -2525,6 +2525,5 @@ pub fn provide(providers: &mut ty::query::Providers) {
|
|||
// We want to check if the panic handler was defined in this crate
|
||||
tcx.lang_items().panic_impl().map_or(false, |did| did.is_local())
|
||||
};
|
||||
providers.source_span =
|
||||
|tcx, def_id| tcx.untracked.source_span.read().get(def_id).copied().unwrap_or(DUMMY_SP);
|
||||
providers.source_span = |tcx, def_id| tcx.untracked.source_span.get(def_id).unwrap_or(DUMMY_SP);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue