From da545be5b5d72ada7538c9ea26349d23ab1752d0 Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 12 Apr 2021 03:24:05 +0000 Subject: [PATCH] Make prefetch more aggressive Former-commit-id: 9cb0be197fb96d7fb3cb697c19b5be313b01337a --- src/db.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 994ee2b41..00a001877 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -3021,8 +3021,13 @@ bool redisDbPersistentData::prefetchKeysAsync(client *c, parsed_command &command auto hT = h & c->db->m_pdict->ht[iht].sizemask; dictEntry **table; __atomic_load(&c->db->m_pdict->ht[iht].table, &table, __ATOMIC_RELAXED); - if (table != nullptr) - _mm_prefetch(table[hT], _MM_HINT_T2); + if (table != nullptr) { + dictEntry *de = table[hT]; + while (de != nullptr) { + _mm_prefetch(dictGetKey(de), _MM_HINT_T2); + de = de->next; + } + } if (!dictIsRehashing(c->db->m_pdict)) break; }