Skip to content

Commit

Permalink
redis-benchmark: disable big buffer cleanup in hiredis context.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
antirez committed Aug 21, 2012
1 parent d6704c9 commit 227b429
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/redis-benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit 227b429

Please sign in to comment.