Unverified Commit 423565f7 authored by lyq2333's avatar lyq2333 Committed by GitHub
Browse files

Optimize CPU cache efficiency on dict while rehashing in dictTwoPhaseUnlinkFind (#12818)

In #5692, we optimize CPU cache efficiency on dict while rehashing but
missed the modification in dictTwoPhaseUnlinkFind.

This PR supplements it.
parent 22cc9b51
...@@ -718,6 +718,7 @@ dictEntry *dictTwoPhaseUnlinkFind(dict *d, const void *key, dictEntry ***plink, ...@@ -718,6 +718,7 @@ dictEntry *dictTwoPhaseUnlinkFind(dict *d, const void *key, dictEntry ***plink,
for (table = 0; table <= 1; table++) { for (table = 0; table <= 1; table++) {
idx = h & DICTHT_SIZE_MASK(d->ht_size_exp[table]); idx = h & DICTHT_SIZE_MASK(d->ht_size_exp[table]);
if (table == 0 && (long)idx < d->rehashidx) continue;
dictEntry **ref = &d->ht_table[table][idx]; dictEntry **ref = &d->ht_table[table][idx];
while (ref && *ref) { while (ref && *ref) {
void *de_key = dictGetKey(*ref); void *de_key = dictGetKey(*ref);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment