Skip to content

Commit

Permalink
Use FxHashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed Mar 3, 2019
1 parent 9d26789 commit f20ad70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustc/util/profiling.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::collections::HashMap;
use std::fs;
use std::io::{BufWriter, Write};
use std::mem;
Expand All @@ -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,
Expand Down Expand Up @@ -57,15 +58,15 @@ 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,
}

impl SelfProfiler {
pub fn new() -> SelfProfiler {
let profiler = SelfProfiler {
events: HashMap::new(),
events: Default::default(),
start_time: SystemTime::now(),
start_instant: Instant::now(),
};
Expand Down

0 comments on commit f20ad70

Please sign in to comment.