mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 09:30:55 +00:00
dict.c benchmark: mixed del/insert benchmark.
This commit is contained in:
parent
0f708ab2a9
commit
bd6c4cade6
11
src/dict.c
11
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user