Pass the currently-being-processed block down to ConnectTip, so it can avoid loading it again from disk.
This results in a 15% speedup for me for reindexing until block 172896 (134s vs 155s).
Pass the currently-being-processed block down to ConnectTip, so it can avoid loading it again from disk.
This results in a 15% speedup for me for reindexing until block 172896 (134s vs 155s).
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4764_92bb6f2f1729192703dd49bb982c1dd4c0062fa0/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
Nice, code changes look good to me, going to test this.
Edit: I benchmarked a full testnet reindex with and without this patch (with time src/bitcoind -datadir=/store/tmp/testbtc -testnet -reindex -stopafterblockimport -disablewallet):
With:
real 21m2.153s user 74m18.716s sys 0m43.476s
real 22m30.468s user 73m45.495s sys 0m41.732s
real 20m12.181s user 74m13.455s sys 0m42.349s
Without:
real 21m2.175s user 74m38.421s sys 0m47.715s
real 20m15.575s user 74m15.827s sys 0m46.672s
Amount of time in 'sys' is a noticeably less with the patch, but the overall time doesn't decrease within the variance of the results.
Repeating your test on the mainnet (time src/bitcoind -datadir=/store/tmp/testbtc -reindex -stopafterblockimport -disablewallet -stopafterblock=172896, dropping kernel caches in between):
With:
real 5m10.073s user 3m11.530s sys 0m19.505s
real 5m6.246s user 3m8.900s sys 0m18.981s
real 5m8.438s user 3m5.312s sys 0m19.045s
Without:
real 5m32.379s user 3m30.707s sys 0m22.530s
real 5m37.136s user 3m32.757s sys 0m23.048s
real 5m33.290s user 3m30.284s sys 0m22.501s
Although I don't get to 15% there is a clear improvement here. ACK.
ut ACK
ut ACK