about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-27 14:04:07 +0000
committerbors <bors@rust-lang.org>2022-02-27 14:04:07 +0000
commit3b1fe7e7c95e14dd8a420edf2f8a160c70211e04 (patch)
tree1104075d21653e369db1b908d13c1c0dc8343e2f /compiler/rustc_data_structures/src
parentbab4c13f64b4197abc1a361796be9940ed5b3904 (diff)
parent594ea74bf0f735c7cd81a54409ab4d9005e07110 (diff)
downloadrust-3b1fe7e7c95e14dd8a420edf2f8a160c70211e04.tar.gz
rust-3b1fe7e7c95e14dd8a420edf2f8a160c70211e04.zip
Auto merge of #94084 - Mark-Simulacrum:drop-sharded, r=cjgillot
Avoid query cache sharding code in single-threaded mode

In non-parallel compilers, this is just adding needless overhead at compilation time (since there is only one shard statically anyway). This amounts to roughly ~10 seconds reduction in bootstrap time, with overall neutral (some wins, some losses) performance results.

Parallel compiler performance should be largely unaffected by this PR; sharding is kept there.
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/sharded.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/sharded.rs b/compiler/rustc_data_structures/src/sharded.rs
index 417c61242a5..01d292dde8d 100644
--- a/compiler/rustc_data_structures/src/sharded.rs
+++ b/compiler/rustc_data_structures/src/sharded.rs
@@ -129,7 +129,7 @@ impl<K: Eq + Hash + Copy + IntoPointer> ShardedHashMap<K, ()> {
 }
 
 #[inline]
-fn make_hash<K: Hash + ?Sized>(val: &K) -> u64 {
+pub fn make_hash<K: Hash + ?Sized>(val: &K) -> u64 {
     let mut state = FxHasher::default();
     val.hash(&mut state);
     state.finish()