go/leveldb
siddontang 781122ece4 update readme, use remote gist to build leveled 2014-05-15 08:44:12 +08:00
..
batch.go add helper function, batch add explicit Close 2014-05-05 17:00:11 +08:00
db.go iterator add offset and limit, reviterator bug fix 2014-05-07 22:53:24 +08:00
dev.sh update readme, use remote gist to build leveled 2014-05-15 08:44:12 +08:00
iterator.go iterator first offset bug fix 2014-05-08 09:22:51 +08:00
leveldb_test.go iterator first offset bug fix 2014-05-08 09:22:51 +08:00
readme.md update readme, use remote gist to build leveled 2014-05-15 08:44:12 +08:00
snapshot.go iterator add offset and limit, reviterator bug fix 2014-05-07 22:53:24 +08:00
util.go update helper function 2014-05-05 17:09:05 +08:00

readme.md

a leveldb wrapper for levigo

simplify use leveldb in go

Build leveldb

see https://gist.github.com/siddontang/dfbc835e06e47d0f6297 for build leveldb

Install

you must first set CGO_CFLAGS, CGO_LDFLAGS to your leveldb and snappy directory.

dev.sh may help you:

. ./dev.sh

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;