diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-17 18:38:30 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-19 16:03:21 +0100 |
| commit | a8522256c5ad5d7ec3b0f10f0d23da84d72ce73a (patch) | |
| tree | 49cb579f0d75a18ca7ba980ea0a0a72ed1c8aa4d /src/librustc_data_structures | |
| parent | 19170cd217c1469fd7d78c6a99caf6b2bfc91f90 (diff) | |
Tune inlining
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/profiling.rs | 9 | ||||
| -rw-r--r-- | src/librustc_data_structures/stable_hasher.rs | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/librustc_data_structures/profiling.rs b/src/librustc_data_structures/profiling.rs index 1d0ac4f4907..f2c80510f22 100644 --- a/src/librustc_data_structures/profiling.rs +++ b/src/librustc_data_structures/profiling.rs @@ -81,6 +81,7 @@ //! //! [mm]: https://github.com/rust-lang/measureme/ +use crate::cold_path; use crate::fx::FxHashMap; use std::borrow::Borrow; @@ -531,9 +532,11 @@ impl<'a> TimingGuard<'a> { #[inline] pub fn finish_with_query_invocation_id(self, query_invocation_id: QueryInvocationId) { if let Some(guard) = self.0 { - let event_id = StringId::new_virtual(query_invocation_id.0); - let event_id = EventId::from_virtual(event_id); - guard.finish_with_override_event_id(event_id); + cold_path(|| { + let event_id = StringId::new_virtual(query_invocation_id.0); + let event_id = EventId::from_virtual(event_id); + guard.finish_with_override_event_id(event_id); + }); } } diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs index 0a26bf3bdc9..a98e77cebd8 100644 --- a/src/librustc_data_structures/stable_hasher.rs +++ b/src/librustc_data_structures/stable_hasher.rs @@ -27,6 +27,7 @@ pub trait StableHasherResult: Sized { } impl StableHasher { + #[inline] pub fn new() -> Self { StableHasher { state: SipHasher128::new_with_keys(0, 0) } } |
