Batch construct batches #9346

pull sipa wants to merge 1 commits into bitcoin:master from sipa:reusebatch changing 1 files +7 −4
  1. sipa commented at 8:33 AM on December 14, 2016: member

    Reuse the serialization buffers used for constructing the LevelDB write batch. This avoids 2 allocations per utxo write.

    I have not benchmarked this exact change, but in another branch I'm working on it results in a 12% speedup for the flush.

  2. Batch construct batches
    Reuse the serialization buffers used for constructing the LevelDB
    write batch. This avoids 2 allocations per utxo write.
    ed5896976a
  3. jonasschnelli added the label UTXO Db and Indexes on Dec 14, 2016
  4. gmaxwell commented at 8:39 AM on December 14, 2016: contributor

    ACK. (I tested this on the above mentioned other branch.)

  5. laanwj commented at 9:05 AM on December 14, 2016: member
  6. in src/dbwrapper.h:None in ed5896976a
      73 |  
      74 | -        CDataStream ssValue(SER_DISK, CLIENT_VERSION);
      75 |          ssValue.reserve(DBWRAPPER_PREALLOC_VALUE_SIZE);
      76 |          ssValue << value;
      77 |          ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent));
      78 |          leveldb::Slice slValue(&ssValue[0], ssValue.size());
    


    laanwj commented at 9:20 AM on December 14, 2016:

    CDataStream should really get a .data(). Not necessarily here though :)


    sipa commented at 8:23 PM on December 16, 2016:

    Agree, but let's do that separately (#9353?).

  7. laanwj approved
  8. MarcoFalke added the label Refactoring on Dec 14, 2016
  9. laanwj cross-referenced this on Dec 15, 2016 from issue Add data() method to CDataStream (and use it) by laanwj
  10. sipa merged this on Dec 16, 2016
  11. sipa closed this on Dec 16, 2016

  12. sipa referenced this in commit b99a093afe on Dec 16, 2016
  13. codablock referenced this in commit 1cdcac139f on Sep 27, 2017
  14. ptschip cross-referenced this on Oct 3, 2017 from issue dbcache phase 3 enhancements by ptschip
  15. codablock referenced this in commit dd7cdb231a on Oct 12, 2017
  16. codablock referenced this in commit b71574380a on Oct 23, 2017
  17. codablock referenced this in commit 6974f1723d on Oct 23, 2017
  18. UdjinM6 referenced this in commit 17c637a251 on Nov 8, 2017
  19. dagurval cross-referenced this on Dec 18, 2017 from issue Batch construct batches by dagurval
  20. nuttycom cross-referenced this on Feb 11, 2021 from issue Backport of bitcoin/bitcoin#10195 by nuttycom
  21. bitcoin 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-05-20 06:55 UTC