summaryrefslogtreecommitdiff
path: root/src/dict.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-09-07 11:06:03 +0200
committerantirez <antirez@gmail.com>2016-09-07 11:06:03 +0200
commit0f708ab2a91ab399a981974dd546b47cfddb09ae (patch)
tree1865a4e77d340b9624780d2715038adc6b1fa085 /src/dict.c
parented6a4517f583c44da1559768e238d71a2a4667b9 (diff)
downloadredis-0f708ab2a91ab399a981974dd546b47cfddb09ae.tar.gz
dict.c benchmark: finish rehashing before testing lookups.
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dict.c b/src/dict.c
index f1cafe2e2..ae9516ffa 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -1150,6 +1150,11 @@ int main(int argc, char **argv) {
end_benchmark("Inserting");
assert((long)dictSize(dict) == count);
+ /* Wait for rehashing. */
+ while (dictIsRehashing(dict)) {
+ dictRehashMilliseconds(dict,100);
+ }
+
start_benchmark();
for (j = 0; j < count; j++) {
sds key = sdsfromlonglong(rand() % count);