Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
txscript: Optimize typeOfScript witness-pubkey-hash
This continues the process of converting the typeOfScript function to use a combination of raw script analysis and the new tokenizer instead of the far less efficient parsed opcodes. In particular, it converts the detection of witness pubkey hash scripts to use raw script analysis and the new tokenizer. The following is a before and after comparison of analyzing a large script: benchmark old ns/op new ns/op delta BenchmarkIsWitnessPubKeyHash-8 61688 62839 +1.87% benchmark old allocs new allocs delta BenchmarkIsWitnessPubKeyHash-8 1 1 +0.00% benchmark old bytes new bytes delta BenchmarkIsWitnessPubKeyHash-8 311299 311299 +0.00%
- Loading branch information