]> 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 19eb49152c749a00774dda1a3a4d9d5681024865..d95bfd8ea817f1452aac8a731bcd332fe9ceb813 100644 (file)
@@ -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 (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;
             }
             } 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);
     }
             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++)
     /* Queue N requests accordingly to the pipeline size. */
     c->obuf = sdsempty();
     for (j = 0; j < config.pipeline; j++)