Created
August 1, 2014 22:19
-
-
Save michael-grunder/c92ef31bb632b3d0ad81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "hiredis.h" | |
#include <time.h> | |
/* Contrived arguments */ | |
const char* argv[] = { "ZUNIONSTORE", "out-set", "5", "one", "two", "three", "four", "five"}; | |
const size_t argvlen[] = {11, 6, 1, 3, 3, 5, 4, 4}; | |
const int argc = 8; | |
/* Runs to perform */ | |
const int N = 1000000; | |
int main(void) { | |
double t1, t2; | |
int i; | |
redisContext *c = redisConnect("127.0.0.1", 6379); | |
t1 = clock(); | |
for(i=0;i<N;i++) { | |
redisAppendCommandArgv(c, argc, (const char **)argv, | |
(const size_t *)argvlen); | |
} | |
t2 = clock(); | |
printf("Timing: %f\n", ((double)t2-t1)/CLOCKS_PER_SEC); | |
redisFree(c); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment