Bypass reloading blocks from disk #4764

pull sipa wants to merge 1 commits into bitcoin:master from sipa:bypassload changing 2 files +27 −18
  1. sipa commented at 12:36 AM on August 26, 2014: member

    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).

  2. Bypass reloading blocks from disk 92bb6f2f17
  3. BitcoinPullTester commented at 12:51 AM on August 26, 2014: none

    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.

  4. laanwj added the label Improvement on Aug 26, 2014
  5. laanwj commented at 6:38 AM on August 26, 2014: member

    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.

  6. TheBlueMatt commented at 3:47 AM on August 27, 2014: member

    ut ACK

  7. jgarzik commented at 8:06 PM on August 27, 2014: contributor

    ut ACK

  8. sipa merged this on Aug 27, 2014
  9. sipa closed this on Aug 27, 2014

  10. sipa referenced this in commit cd3d80be67 on Aug 27, 2014
  11. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me