]> git.saurik.com Git - redis.git/blobdiff - src/redis-benchmark.c
Merge pull request #693 from ghurrell/dict-h-typos
[redis.git] / src / redis-benchmark.c
index 36f27540fe6e0e685701a4edad772f685e322466..d95bfd8ea817f1452aac8a731bcd332fe9ceb813 100644 (file)
@@ -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++)