summaryrefslogtreecommitdiff
path: root/src/dict.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-09-07 12:34:37 +0200
committerantirez <antirez@gmail.com>2016-09-07 12:34:53 +0200
commitbd6c4cade6d2d3c19309cf8251656a0336d6bd7f (patch)
tree95e2581d9c4dcd7474aef8de9d3dc6cb47ecb5e3 /src/dict.c
parent0f708ab2a91ab399a981974dd546b47cfddb09ae (diff)
downloadredis-bd6c4cade6d2d3c19309cf8251656a0336d6bd7f.tar.gz
dict.c benchmark: mixed del/insert benchmark.
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dict.c b/src/dict.c
index ae9516ffa..b15ae4876 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -1173,5 +1173,16 @@ int main(int argc, char **argv) {
sdsfree(key);
}
end_benchmark("Accessing missing");
+
+ start_benchmark();
+ for (j = 0; j < count; j++) {
+ sds key = sdsfromlonglong(j);
+ int retval = dictDelete(dict,key);
+ assert(retval == DICT_OK);
+ key[0] += 17; /* Change first number to letter. */
+ retval = dictAdd(dict,key,(void*)j);
+ assert(retval == DICT_OK);
+ }
+ end_benchmark("Removing and adding");
}
#endif