Make prefetch more aggressive

Former-commit-id: 9cb0be197fb96d7fb3cb697c19b5be313b01337a
This commit is contained in:
John Sully 2021-04-12 03:24:05 +00:00
parent 5ccaa9265c
commit da545be5b5

View File

@ -3021,8 +3021,13 @@ bool redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command
auto hT = h & c->db->m_pdict->ht[iht].sizemask; auto hT = h & c->db->m_pdict->ht[iht].sizemask;
dictEntry **table; dictEntry **table;
__atomic_load(&c->db->m_pdict->ht[iht].table, &table, __ATOMIC_RELAXED); __atomic_load(&c->db->m_pdict->ht[iht].table, &table, __ATOMIC_RELAXED);
if (table != nullptr) if (table != nullptr) {
_mm_prefetch(table[hT], _MM_HINT_T2); dictEntry *de = table[hT];
while (de != nullptr) {
_mm_prefetch(dictGetKey(de), _MM_HINT_T2);
de = de->next;
}
}
if (!dictIsRehashing(c->db->m_pdict)) if (!dictIsRehashing(c->db->m_pdict))
break; break;
} }