X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/59132e42125c43299c428e86f9107493e173883e..af0b220756571bc8faf57a0c7b7389dd86a60376:/src/redis-benchmark.c?ds=inline diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c index 19eb4915..8d72573d 100644 --- a/src/redis-benchmark.c +++ b/src/redis-benchmark.c @@ -1,6 +1,6 @@ /* Redis benchmark utility. * - * Copyright (c) 2009-2010, Salvatore Sanfilippo + * Copyright (c) 2009-2012, Salvatore Sanfilippo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -201,7 +201,10 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { 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; } @@ -263,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++)