X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/f6da155bde4c187325deee8b40fe41d45f40468d..ecd82f59fe5296de2733154bfcf1a4b95d4547aa:/src/redis-benchmark.c diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c index 36f27540..d95bfd8e 100644 --- a/src/redis-benchmark.c +++ b/src/redis-benchmark.c @@ -196,10 +196,15 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { exit(1); } + freeReplyObject(reply); + if (config.requests_finished < config.requests) config.latency[config.requests_finished++] = c->latency; c->pending--; - if (c->pending == 0) clientDone(c); + if (c->pending == 0) { + clientDone(c); + break; + } } else { break; } @@ -261,6 +266,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++)