Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txscript: optimize IsUnspendable by removing all allocations #1375

Closed
wants to merge 1 commit into from

Commits on Jan 18, 2019

  1. txscript: optimize IsUnspendable by removing all allocations

    During my work to optimize the IBD of btcd, I've been profiling heavily.
    I've noticed that this call `IsUnspendable` shows up in several hot
    spots during block validation, as we need to know if we should add a
    UTXO to the view/cache, etc. The current version uses `parseScript` to
    parse out all the pops and such. This is nice when we want to be able to
    easily manipulate things like data pushes, but for this simple check,
    it's unnecessary. The new version simply makes checks against the raw
    script which saves us a ton of allocations and CPU cycles.
    Roasbeef committed Jan 18, 2019
    Configuration menu
    Copy the full SHA
    709fdb8 View commit details
    Browse the repository at this point in the history