Commit Graph

8 Commits

Author SHA1 Message Date
Braydon Fuller 7aabf02719 db: add options to configure block index database
There was a previous assumption that blockindex would be quite small. With addressindex
and spentindex enabled the blockindex is much larger and the amount of cache allocated for
it should also increase. Furthermore, enabling compression should decrease the amount of
disk space required and less data to write/read. The default leveldb max_open_files is set to
1000, for the blockindex the default is set to 1000 with compression. The 64 value that is
current is kept for the utxo database and does not enable compression. Two additional options
are added here to be able to configure the values for leveldb and the block index:

- `-dbmaxopenfiles` A number of files for leveldb to keep open
- `-dbcompression` Boolean 0 or 1 to enable snappy leveldb compression
2018-09-05 13:05:50 -07:00
Pieter Wuille 87a5975ca0
Use fixed preallocation instead of costly GetSerializeSize
Dbwrapper used GetSerializeSize() to compute the size of the buffer
to preallocate. For some cases (specifically: CCoins) this requires
a costly compression call. Avoid this by just using fixed size
preallocations instead.
2018-04-17 13:09:48 +01:00
Jack Grigg a8e5ae92ba
GetSerializeSize changes in Zcash-specific code 2018-04-16 07:38:38 -06:00
Pieter Wuille b8a6579366
Make GetSerializeSize a wrapper on top of CSizeComputer
Given that in default GetSerializeSize implementations created by
ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid
of the specialized GetSerializeSize methods everywhere, and just use
CSizeComputer. This removes a lot of code which isn't actually used
anywhere.

For CCompactSize and CVarInt this actually removes a more efficient
size computing algorithm, which is brought back in a later commit.
2018-04-16 07:38:38 -06:00
Pavel Janík 56aa25684c
Do not shadow members in dbwrapper 2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan 3923bcca7c
dbwrapper: Move `HandleError` to `dbwrapper_private`
HandleError is implementation-specific.
2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan 809a429ecf
dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator
Zcash: Makes future extensions easier.

Original description (when this was introduced upstream):

Pass parent wrapper directly instead of obfuscation key. This
makes it possible for other databases which re-use this code
to use other properties from the database.

Add a namespace dbwrapper_private for private functions to be used
only in dbwrapper.h/cpp and dbwrapper_tests.
2018-04-03 20:40:54 +01:00
Jeff Garzik e3da7a572d
leveldbwrapper file rename to dbwrapper.* 2018-04-03 20:40:54 +01:00