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. sipa merged this on Dec 16, 2016
  10. sipa closed this on Dec 16, 2016

  11. sipa referenced this in commit b99a093afe on Dec 16, 2016
  12. codablock referenced this in commit 1cdcac139f on Sep 27, 2017
  13. codablock referenced this in commit dd7cdb231a on Oct 12, 2017
  14. codablock referenced this in commit b71574380a on Oct 23, 2017
  15. codablock referenced this in commit 6974f1723d on Oct 23, 2017
  16. UdjinM6 referenced this in commit 17c637a251 on Nov 8, 2017
  17. DrahtBot 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-13 18:15 UTC

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