]> git.saurik.com Git - redis.git/commitdiff
Add benchmark for MSET
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 15 Oct 2010 16:17:06 +0000 (18:17 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 15 Oct 2010 16:17:06 +0000 (18:17 +0200)
src/redis-benchmark.c

index ce230180656327cab8e4cc34343131c54f2ff1d6..c5ababf2ad3c03d9f4edf95eabe41e3a965fc782 100644 (file)
@@ -575,6 +575,24 @@ int main(int argc, char **argv) {
         aeMain(config.el);
         endBenchmark();
 
+        prepareForBenchmark("MSET (10 keys, multi bulk)");
+        c = createClient();
+        if (!c) exit(1);
+        c->obuf = sdscatprintf(c->obuf,"*%d\r\n$4\r\nMSET\r\n", 11);
+        {
+            int i;
+            char *data = zmalloc(config.datasize+2);
+            memset(data,'x',config.datasize);
+            for (i = 0; i < 10; i++) {
+                c->obuf = sdscatprintf(c->obuf,"$%d\r\n%s\r\n",config.datasize,data);
+            }
+            zfree(data);
+        }
+        prepareClientForReply(c,REPLY_RETCODE);
+        createMissingClients(c);
+        aeMain(config.el);
+        endBenchmark();
+
         prepareForBenchmark("SET");
         c = createClient();
         if (!c) exit(1);