|
|
Batch commit blocks to reduce syncs
Previously, committing a block would require as many as four syncs:
* A sync to the block file itself
* A sync to open the block index database
* A sync to commit the block index transaction (+1 for each subtxn)
* A sync to close the block index transaction
When this is performed for every block, and you have 60k+ to commit,
these syncs take a significant amount of time.
This patch queues blocks to be committed in a seperate thread, once
every second. This commit performs a single commit/sync at the very
end of the process, greatly reducing the amount of time spent syncing,
without compromising data integrity.
|