Add a useful comment about the RawList stable hash cache.
I tried removing it to see what happened. Not a good idea!
This commit is contained in:
parent
09eb497396
commit
e35fd451a0
1 changed files with 3 additions and 0 deletions
|
|
@ -20,6 +20,9 @@ where
|
|||
T: HashStable<StableHashingContext<'a>>,
|
||||
{
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
||||
// Note: this cache makes an *enormous* performance difference on certain benchmarks. E.g.
|
||||
// without it, compiling `diesel-2.2.10` can be 74% slower, and compiling
|
||||
// `deeply-nested-multi` can be ~4,000x slower(!)
|
||||
thread_local! {
|
||||
static CACHE: RefCell<FxHashMap<(*const (), HashingControls), Fingerprint>> =
|
||||
RefCell::new(Default::default());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue