From 0f708ab2a91ab399a981974dd546b47cfddb09ae Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 7 Sep 2016 11:06:03 +0200 Subject: [PATCH] dict.c benchmark: finish rehashing before testing lookups. --- src/dict.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dict.c b/src/dict.c index f1cafe2e..ae9516ff 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);