mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
txscript: Add multisig redeem script extract bench.
This commit is contained in:
parent
c596826688
commit
b0f5561776
@ -472,3 +472,20 @@ func BenchmarkCalcMultiSigStats(b *testing.B) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkMultisigRedeemScript benchmarks how long it takes to extract the
|
||||
// redeem script for a very large script.
|
||||
func BenchmarkMultisigRedeemScript(b *testing.B) {
|
||||
// NOTE: This isn't actually a p2sh multisig which the function being
|
||||
// benchmarked expects, but it is acceptable for the purposes of the
|
||||
// benchmark.
|
||||
script, err := genComplexScript()
|
||||
if err != nil {
|
||||
b.Fatalf("failed to create benchmark script: %v", err)
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, _ = MultisigRedeemScriptFromScriptSig(script)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user