Skip to content

Commit d1ac877

Browse files
committed
Use FxHashMap
1 parent 2fb8d60 commit d1ac877

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc/util/profiling.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::collections::HashMap;
21
use std::fs;
32
use std::io::{BufWriter, Write};
43
use std::mem;
@@ -8,6 +7,8 @@ use std::time::{Duration, Instant, SystemTime};
87

98
use crate::session::config::Options;
109

10+
use rustc_data_structures::fx::FxHashMap;
11+
1112
#[derive(Clone, Copy, Debug, PartialEq, Eq, Ord, PartialOrd)]
1213
pub enum ProfileCategory {
1314
Parsing,
@@ -57,15 +58,15 @@ fn thread_id_to_u64(tid: ThreadId) -> u64 {
5758
}
5859

5960
pub struct SelfProfiler {
60-
events: HashMap<ThreadId, Vec<ProfilerEvent>>,
61+
events: FxHashMap<ThreadId, Vec<ProfilerEvent>>,
6162
start_time: SystemTime,
6263
start_instant: Instant,
6364
}
6465

6566
impl SelfProfiler {
6667
pub fn new() -> SelfProfiler {
6768
let profiler = SelfProfiler {
68-
events: HashMap::new(),
69+
events: Default::default(),
6970
start_time: SystemTime::now(),
7071
start_instant: Instant::now(),
7172
};

0 commit comments

Comments
 (0)