mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-17 03:26:41 +00:00

* [NOD-1048] Make leveldb compaction much less frequent. Also, allocate an entire gigabyte for leveldb's blockCache and writeBuffer. * [NOD-1048] Implement changing the options for testing purposes. * [NOD-1048] Rename originalOptions to originalLDBOptions. * [NOD-1048] Add a comment.
20 lines
479 B
Go
20 lines
479 B
Go
package ldb
|
|
|
|
import "github.com/syndtr/goleveldb/leveldb/opt"
|
|
|
|
var (
|
|
defaultOptions = opt.Options{
|
|
Compression: opt.NoCompression,
|
|
BlockCacheCapacity: 512 * opt.MiB,
|
|
WriteBuffer: 512 * opt.MiB,
|
|
IteratorSamplingRate: 512 * opt.MiB,
|
|
}
|
|
|
|
// Options is a function that returns a leveldb
|
|
// opt.Options struct for opening a database.
|
|
// It's defined as a variable for the sake of testing.
|
|
Options = func() *opt.Options {
|
|
return &defaultOptions
|
|
}
|
|
)
|