Excessive rehashing adds latency
Former-commit-id: 9db2277b0fea032abcde089f617fe7e4f5ce12e3
This commit is contained in:
parent
74d73b4ca3
commit
b8c03fd014
@ -546,7 +546,7 @@ int dictRehashMilliseconds(dict *d, int ms) {
|
|||||||
static void _dictRehashStep(dict *d) {
|
static void _dictRehashStep(dict *d) {
|
||||||
unsigned iterators;
|
unsigned iterators;
|
||||||
__atomic_load(&d->iterators, &iterators, __ATOMIC_RELAXED);
|
__atomic_load(&d->iterators, &iterators, __ATOMIC_RELAXED);
|
||||||
if (iterators == 0) dictRehash(d,2);
|
if (iterators == 0) dictRehash(d,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add an element to the target hash table */
|
/* Add an element to the target hash table */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user