Skip to content

Instantly share code, notes, and snippets.

View BohuTANG's full-sized avatar

Bohu BohuTANG

View GitHub Profile
@BohuTANG
BohuTANG / nessDB_benchmark_Mac_OS
Created October 17, 2011 14:27
nessDB benchmark results on Mac OS x
Keys: 20 bytes each
Values: 100 bytes each
Entries: 5000000
IndexSize: 324.2 MB (estimated)
DataSize: 515.0 MB (estimated)
BG SYNC: close...
------------------------------------------------------------------------------------------------------------
nessDB: version 1.7(Multiple && Distributable B+Tree with Level-LRU,Background IO Sync)
Date: Mon Oct 17 22:09:40 2011
+-----------------------+---------------------------+----------------------------------+---------------------+
@BohuTANG
BohuTANG / nessDB_CH
Created October 21, 2011 02:51
nessDB中文文档
nessDB是一个小巧、高性能的、支持Redis协议的K-V数据库,使用标准C开发,支持Linux, *BSD, OS X and Solaris 系统,无第三方依赖。
描述:
* 使用Bloom filter检查数据存在性
* 使用Level-LRU提升随机读性能,类似于InnoDB的bufferpool,大小可配置。
* 可分布存储的B+Tree索引文件
* Redis协议支持(PING,GET,MGET,SET,MSET,DEL,INFO):SET相同的key即更新;DEL后面跟多key,即批量删除
源码目录结构
@BohuTANG
BohuTANG / gdb-remote.c
Created March 10, 2012 09:32
modify the gdb's remote.c to support long-buffer output when debug linux kernel
change:
if (buf_len > 2 * rsa->sizeof_g_packet)
error (_(“Remote ‘g’ packet reply is too long: %s”), rs->buf);
to:
if (buf_len > 2 * rsa->sizeof_g_packet) {
rsa->sizeof_g_packet = buf_len ;
for (i = 0; i < gdbarch_num_regs (gdbarch); i++)
{
if (rsa->regs[i].pnum == -1)
@BohuTANG
BohuTANG / lsm-tree-1yi
Created March 19, 2012 08:21
LSM-tree storage engine benchmark
BohuTANG@BohuTANG:~/github/lsm-tree$ ./bench write 100000000
Keys: 16 bytes each
Values: 80 bytes each
Entries: 100000000
IndexSize: 2384.2 MB (estimated)
DataSize: 8010.9 MB (estimated)
---------------------------------------------------------------------------------------------------
nessDB: version 1.8(LSM-Tree storage engine)
Date: Mon Mar 19 15:51:07 2012
CPU: 4 * Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
@BohuTANG
BohuTANG / nessDB-benchmark
Created March 29, 2012 08:51
nessDB's benchmark results with:1000k,10000k,50000k and 100m records
RANDOM-WRITE RESULTS(1000k records)
===================================
Keys: 16 bytes each
Values: 80 bytes each
Entries: 1000000
IndexSize: 23.8 MB (estimated)
DataSize: 80.1 MB (estimated)
---------------------------------------------------------------------------------------------------
nessDB: version 1.8(LSM-Tree storage engine)
Date: Thu Mar 29 16:49:40 2012
@BohuTANG
BohuTANG / gist:2908744
Created June 11, 2012 06:33
arxiv.org fetcher
import re
import urllib
url = "http://arxiv.org/list/cs.DB/recent"
s=urllib.urlopen(url).read()
ss = s.replace("\n","")
titles=re.findall('<span class="descriptor">Title:</span>(.+?)</div>', ss, re.I)
i = 0;
for t in titles:
print '(%d) %s' %(i, t)
@BohuTANG
BohuTANG / gist:2908745
Created June 11, 2012 06:34
arxiv.org fetcher
import re
import urllib
url = "http://arxiv.org/list/cs.DB/recent"
s=urllib.urlopen(url).read()
ss = s.replace("\n","")
titles=re.findall('<span class="descriptor">Title:</span>(.+?)</div>', ss, re.I)
i = 0
for t in titles:
print '(%d) %s' %(i, t)
@BohuTANG
BohuTANG / big.c
Last active December 19, 2015 07:09
Fixed: from buffer to uint64_t with big-endian sign extension bug
/*
* Such as num is:12345678910, 'from_big1' funcation will be wrong
* since the sign extension: 'cltq' instruction will full fill upper 32 bits with 0xffffffff
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
void to_big(unsigned char *buf, uint64_t v)
@BohuTANG
BohuTANG / nessDB-solaris.patch
Created July 16, 2013 05:11
nessDB solaris patch, from fc
diff --git a/Makefile b/Makefile
index 5631c4d..0e1e04e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
CC = gcc
#debug levle
-DOG = -rdynamic -DDOG
-DEBUG = -g -ggdb -DINFO $(DOG)
/*
* CascaDB crc32 algorithm and test
* refer to https://code.google.com/p/leveldb/source/browse/util/crc32c.cc
* BohuTANG
* 2013/08/27
*/
#include <stdio.h>
#include <stdint.h>
#include <string.h>