summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-08-21 17:31:44 +0200
committerantirez <antirez@gmail.com>2012-08-21 17:31:44 +0200
commit227b4293647d51244771d16f0ad14bc94a2b3ad9 (patch)
treefc8105f25c643d7614d60936efbeaad8e684d910
parentd6704c9bd0f03f277ee23a4e3e1fc86a74e130b3 (diff)
downloadredis-227b4293647d51244771d16f0ad14bc94a2b3ad9.tar.gz
redis-benchmark: disable big buffer cleanup in hiredis context.
This new hiredis features allows us to reuse a previous context reader buffer even if already very big in order to maximize performances with big payloads (Usually hiredis re-creates buffers when they are too big and unused in order to save memory).
-rw-r--r--src/redis-benchmark.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index 19eb49152..1be4c07d9 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -263,6 +263,8 @@ static client createClient(char *cmd, size_t len) {
fprintf(stderr,"%s: %s\n",config.hostsocket,c->context->errstr);
exit(1);
}
+ /* Suppress hiredis cleanup of unused buffers for max speed. */
+ c->context->reader->maxbuf = 0;
/* Queue N requests accordingly to the pipeline size. */
c->obuf = sdsempty();
for (j = 0; j < config.pipeline; j++)