Skip to content

Commit 02aa397

Browse files
committed
Changed TaskDeps to start with preallocated with 1024 capacity
1 parent 28b83ee commit 02aa397

File tree

2 files changed

+3
-3
lines changed
  • compiler
    • rustc_data_structures/src
    • rustc_query_system/src/dep_graph

2 files changed

+3
-3
lines changed

compiler/rustc_data_structures/src/fx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::hash::BuildHasherDefault;
22

3-
pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
3+
pub use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet, FxHasher};
44

55
pub type StdEntry<'a, K, V> = std::collections::hash_map::Entry<'a, K, V>;
66

compiler/rustc_query_system/src/dep_graph/graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77
use std::sync::atomic::{AtomicU32, Ordering};
88

99
use rustc_data_structures::fingerprint::Fingerprint;
10-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
10+
use rustc_data_structures::fx::{FxBuildHasher, FxHashMap, FxHashSet};
1111
use rustc_data_structures::profiling::{QueryInvocationId, SelfProfilerRef};
1212
use rustc_data_structures::sharded::{self, Sharded};
1313
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
@@ -1299,7 +1299,7 @@ impl Default for TaskDeps {
12991299
#[cfg(debug_assertions)]
13001300
node: None,
13011301
reads: EdgesVec::new(),
1302-
read_set: FxHashSet::default(),
1302+
read_set: FxHashSet::with_capacity_and_hasher(1024, FxBuildHasher::default()),
13031303
phantom_data: PhantomData,
13041304
}
13051305
}

0 commit comments

Comments
 (0)