]> git.lizzy.rs Git - rust.git/commitdiff
Use FxHashMap
authorWesley Wiser <wwiser@gmail.com>
Mon, 25 Feb 2019 23:46:53 +0000 (18:46 -0500)
committerWesley Wiser <wwiser@gmail.com>
Sun, 3 Mar 2019 15:07:32 +0000 (10:07 -0500)
src/librustc/util/profiling.rs

index c052f00cd18e3ccee47afc1dbf5aefabf91f8ee1..c134d48f987be5ded1c711a6b0f8786545d30c8a 100644 (file)
@@ -1,4 +1,3 @@
-use std::collections::HashMap;
 use std::fs;
 use std::io::{BufWriter, Write};
 use std::mem;
@@ -8,6 +7,8 @@
 
 use crate::session::config::Options;
 
+use rustc_data_structures::fx::FxHashMap;
+
 #[derive(Clone, Copy, Debug, PartialEq, Eq, Ord, PartialOrd)]
 pub enum ProfileCategory {
     Parsing,
@@ -57,7 +58,7 @@ fn thread_id_to_u64(tid: ThreadId) -> u64 {
 }
 
 pub struct SelfProfiler {
-    events: HashMap<ThreadId, Vec<ProfilerEvent>>,
+    events: FxHashMap<ThreadId, Vec<ProfilerEvent>>,
     start_time: SystemTime,
     start_instant: Instant,
 }
@@ -65,7 +66,7 @@ pub struct SelfProfiler {
 impl SelfProfiler {
     pub fn new() -> SelfProfiler {
         let profiler = SelfProfiler {
-            events: HashMap::new(),
+            events: Default::default(),
             start_time: SystemTime::now(),
             start_instant: Instant::now(),
         };