about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2018-05-17 13:51:27 -0600
committerGitHub <noreply@github.com>2018-05-17 13:51:27 -0600
commit54df1bf200754292b24ff8b70ab9dcc7d583bf4a (patch)
tree57ee502e8d6eaded1a5d777bff73e5b8df3cade8 /src/librustc_data_structures
parentf83e4d74076c4ac82cde6abe6abe54a946e7feb8 (diff)
parent47bc774ab6b23f0e01bf4672d36ed9f8d7e3e798 (diff)
downloadrust-54df1bf200754292b24ff8b70ab9dcc7d583bf4a.tar.gz
rust-54df1bf200754292b24ff8b70ab9dcc7d583bf4a.zip
Rollup merge of #50818 - nnethercote:faster-normalize, r=nikomatsakis
Speed up `opt_normalize_projection_type`

`opt_normalize_projection_type` is hot in the serde and futures benchmarks in rustc-perf. These two patches speed up the execution of most runs for them by 2--4%.
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/snapshot_map/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_data_structures/snapshot_map/mod.rs b/src/librustc_data_structures/snapshot_map/mod.rs
index cede6f14782..6ee8c3579f5 100644
--- a/src/librustc_data_structures/snapshot_map/mod.rs
+++ b/src/librustc_data_structures/snapshot_map/mod.rs
@@ -67,6 +67,12 @@ impl<K, V> SnapshotMap<K, V>
         }
     }
 
+    pub fn insert_noop(&mut self) {
+        if !self.undo_log.is_empty() {
+            self.undo_log.push(UndoLog::Noop);
+        }
+    }
+
     pub fn remove(&mut self, key: K) -> bool {
         match self.map.remove(&key) {
             Some(old_value) => {