From ff490a6d5284933591fef53e4183317b3989d51c Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Thu, 30 Oct 2014 02:25:34 -0700 Subject: [PATCH] perf(core/datastore) disable snappy compression --- core/datastore.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/datastore.go b/core/datastore.go index 80af459f0..cb185e474 100644 --- a/core/datastore.go +++ b/core/datastore.go @@ -8,6 +8,7 @@ import ( ktds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/keytransform" lds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/leveldb" syncds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync" + ldbopts "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/opt" config "github.com/jbenet/go-ipfs/config" u "github.com/jbenet/go-ipfs/util" @@ -43,5 +44,8 @@ func makeLevelDBDatastore(cfg config.Datastore) (ds.ThreadSafeDatastore, error) return nil, fmt.Errorf("config datastore.path required for leveldb") } - return lds.NewDatastore(cfg.Path, nil) + return lds.NewDatastore(cfg.Path, &lds.Options{ + // TODO don't import ldbopts. Get from go-datastore.leveldb + Compression: ldbopts.NoCompression, + }) }