Skip to content

Instantly share code, notes, and snippets.

View sunxiaoguang's full-sized avatar

Xiaoguang Sun sunxiaoguang

  • PingCAP
  • Beijing, People's Republic of China
  • X @xgsun
View GitHub Profile
@sunxiaoguang
sunxiaoguang / benchmark.c
Created August 14, 2017 07:48
hgetall optimization sample data generator and benchmark code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hiredis.h>
#include <sys/time.h>
long long elapsed(struct timeval *start, struct timeval *end) {
return (end->tv_sec * 1000000l + end->tv_usec) - (start->tv_sec * 1000000l + start->tv_usec);
}