1
Fork 0

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.
This commit is contained in:
bors 2022-02-27 14:04:07 +00:00
commit 3b1fe7e7c9
8 changed files with 167 additions and 204 deletions

View file

@ -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()