mirror of https://github.com/tidwall/buntdb.git
increased default btree degrees
This commit is contained in:
parent
f240a9c339
commit
3e58c89ec6
|
@ -122,12 +122,15 @@ type exctx struct {
|
||||||
db *DB
|
db *DB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Default number of btree degrees
|
||||||
|
const btreeDegrees = 64
|
||||||
|
|
||||||
// Open opens a database at the provided path.
|
// Open opens a database at the provided path.
|
||||||
// If the file does not exist then it will be created automatically.
|
// If the file does not exist then it will be created automatically.
|
||||||
func Open(path string) (*DB, error) {
|
func Open(path string) (*DB, error) {
|
||||||
db := &DB{}
|
db := &DB{}
|
||||||
db.keys = btree.New(16, nil)
|
db.keys = btree.New(btreeDegrees, nil)
|
||||||
db.exps = btree.New(16, &exctx{db})
|
db.exps = btree.New(btreeDegrees, &exctx{db})
|
||||||
db.idxs = make(map[string]*index)
|
db.idxs = make(map[string]*index)
|
||||||
db.config = Config{
|
db.config = Config{
|
||||||
SyncPolicy: EverySecond,
|
SyncPolicy: EverySecond,
|
||||||
|
@ -248,7 +251,7 @@ func (db *DB) createIndex(
|
||||||
db: db,
|
db: db,
|
||||||
}
|
}
|
||||||
if less != nil {
|
if less != nil {
|
||||||
idx.btr = btree.New(16, idx)
|
idx.btr = btree.New(btreeDegrees, idx)
|
||||||
}
|
}
|
||||||
if rect != nil {
|
if rect != nil {
|
||||||
idx.rtr = rtree.New(idx)
|
idx.rtr = rtree.New(idx)
|
||||||
|
|
Loading…
Reference in New Issue