-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSDB: metrics and performance improvements (#2184)
- Reuses the existing eth/leveldb module to bring I/O-related metrics to the Roundstate DB. - Increases default Level DB values related to the block size, cache capacity, write buffer size and compaction table size to reduce the amount of I/O operations and the number of non-level0 compactions of both State and Roundstate DBs.
- Loading branch information
Showing
3 changed files
with
96 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package leveldb | ||
|
||
import ( | ||
"github.com/celo-org/celo-blockchain/ethdb" | ||
"github.com/syndtr/goleveldb/leveldb" | ||
"github.com/syndtr/goleveldb/leveldb/storage" | ||
"github.com/syndtr/goleveldb/leveldb/util" | ||
) | ||
|
||
// NewInMemory returns a wrapped LevelDB object with an in-memory storage. | ||
func NewInMemory() (*Database, error) { | ||
db, err := leveldb.Open(storage.NewMemStorage(), nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &Database{ | ||
db: db, | ||
}, nil | ||
} | ||
|
||
// NewRangeIterator creates an over a subset of database content starting at | ||
// and ending at a particular key. | ||
func (db *Database) NewRangeIterator(rang *util.Range) ethdb.Iterator { | ||
return db.db.NewIterator(rang, nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters