From f20ad7043904023e810cfaeb5d775f281a4a1619 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Mon, 25 Feb 2019 18:46:53 -0500 Subject: [PATCH] Use FxHashMap --- src/librustc/util/profiling.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustc/util/profiling.rs b/src/librustc/util/profiling.rs index c052f00cd18e3..c134d48f987be 100644 --- a/src/librustc/util/profiling.rs +++ b/src/librustc/util/profiling.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::fs; use std::io::{BufWriter, Write}; use std::mem; @@ -8,6 +7,8 @@ use std::time::{Duration, Instant, SystemTime}; 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>, + events: FxHashMap>, 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(), };