Skip to content

Commit 9512016

Browse files
committed
Inline try_get.
This speeds up lots of rustc-perf benchmark runs. The maximum improvement is 1%, but there are a lot in the 0.5--1.0% range.
1 parent 4c26e2e commit 9512016

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/ty/maps/plumbing.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
105105
/// start executing the query, or it returns with the result of the query.
106106
/// If the query is executing elsewhere, this will wait for it.
107107
/// If the query panicked, this will silently panic.
108+
///
109+
/// This function is inlined because that results in a noticeable speedup
110+
/// for some compile-time benchmarks.
111+
#[inline(always)]
108112
pub(super) fn try_get(
109113
tcx: TyCtxt<'a, 'tcx, '_>,
110114
span: Span,

0 commit comments

Comments
 (0)