2014-04-18 10:50:29 +04:00
|
|
|
a leveldb wrapper for levigo
|
|
|
|
|
|
|
|
simplify use leveldb in go
|
|
|
|
|
2014-05-15 04:44:12 +04:00
|
|
|
# Build leveldb
|
|
|
|
|
|
|
|
see [https://gist.github.com/siddontang/dfbc835e06e47d0f6297](https://gist.github.com/siddontang/dfbc835e06e47d0f6297) for build leveldb
|
|
|
|
|
2014-04-18 10:50:29 +04:00
|
|
|
# Install
|
|
|
|
|
2014-05-15 04:44:12 +04:00
|
|
|
you must first set CGO_CFLAGS, CGO_LDFLAGS to your leveldb and snappy directory.
|
|
|
|
|
|
|
|
dev.sh may help you:
|
|
|
|
|
|
|
|
. ./dev.sh
|
2014-05-09 05:46:50 +04:00
|
|
|
|
|
|
|
# Performance
|
|
|
|
|
|
|
|
for better performance, I change some leveldb configurations to build:
|
|
|
|
|
|
|
|
+ db/dbformat.h
|
|
|
|
|
|
|
|
// static const int kL0_SlowdownWritesTrigger = 8;
|
|
|
|
static const int kL0_SlowdownWritesTrigger = 16;
|
|
|
|
|
|
|
|
// static const int kL0_StopWritesTrigger = 12;
|
|
|
|
static const int kL0_StopWritesTrigger = 64;
|
|
|
|
|
|
|
|
+ db/version_set.cc
|
|
|
|
|
|
|
|
//static const int kTargetFileSize = 2 * 1048576;
|
|
|
|
static const int kTargetFileSize = 32 * 1048576;
|
|
|
|
|
|
|
|
//static const int64_t kMaxGrandParentOverlapBytes = 10 * kTargetFileSize;
|
|
|
|
static const int64_t kMaxGrandParentOverlapBytes = 20 * kTargetFileSize;
|
|
|
|
|
|
|
|
|