Optimize GetWitnessHash() for non-segwit transactions #9912

pull sdaftuar wants to merge 1 commits into bitcoin:master from sdaftuar:2017-03-optimize-witness-hash changing 1 files +3 −0
  1. sdaftuar commented at 6:49 PM on March 3, 2017: member

    I've been investigating performance of CreateNewBlock(), and one performance regression I spotted was added in #9189, when we started always calculating the witness commitment (even before segwit has activated). This is particularly slow because we don't currently cache the witness hash of a transaction.

    The coinbase commitment takes about 8ms to generate currently; after this patch this time is reduced to about 1.5ms.

    I think this also ought to speed up compact block performance, but I haven't tried to benchmark.

    (I think in an ideal world, we'd go further and cache these witness hashes for segwit transactions as well -- I proposed one approach in #9700, and I tried another approach for a similar kind of caching benefit in #9709, but need reviewer feedback to figure out how to move forward.)

  2. Optimize GetWitnessHash() for non-segwit transactions 02c57b521a
  3. fanquake added the label Refactoring on Mar 3, 2017
  4. TheBlueMatt commented at 12:09 AM on March 4, 2017: member

    Obvious utACK 02c57b521a9e7afd4416cd027a8b397f202b08a8.

  5. dcousens approved
  6. laanwj added the label Needs backport on Mar 7, 2017
  7. laanwj added this to the milestone 0.14.1 on Mar 7, 2017
  8. laanwj commented at 10:03 AM on March 7, 2017: member

    Eh ,yes. utACK 02c57b5

  9. laanwj merged this on Mar 7, 2017
  10. laanwj closed this on Mar 7, 2017

  11. laanwj referenced this in commit 6015df5b85 on Mar 7, 2017
  12. MarcoFalke referenced this in commit ca1537de75 on Mar 27, 2017
  13. MarcoFalke removed the label Needs backport on Mar 27, 2017
  14. MarcoFalke referenced this in commit fc3d7db580 on Mar 27, 2017
  15. 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-14 12:15 UTC

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