Retrieving coins from disk is a significant source of ConnectBlock
latency. This PR increases ConnectBlock
speed by retrieving coins from disk on a separate thread before ConnectBlock
is reached. When a block is passed into ProcessNewBlock
it is immediately warmed before prevalidation checks are begun.
Benchmarking IBD with -prune=10000
and default -dbcache
from blocks 600000-633000
gives a 7.1% increase in speed. Since this is only really useful when blocks take a long time to prevalidate, benchmarks from genesis only give a 2.3% increase. However, this should keep increasing as more large blocks get mined, so it will be even more useful in the future. Of course this will be less useful with high -dbcache
values.