txscript: Add benchmark for IsPushOnlyScript.
This commit is contained in:
parent
6be04a8e43
commit
2b5edd2b5e
1 changed files with 15 additions and 0 deletions
|
@ -267,3 +267,18 @@ func BenchmarkIsMultisigSigScript(b *testing.B) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BenchmarkIsPushOnlyScript benchmarks how long it takes IsPushOnlyScript to
|
||||||
|
// analyze a very large script.
|
||||||
|
func BenchmarkIsPushOnlyScript(b *testing.B) {
|
||||||
|
script, err := genComplexScript()
|
||||||
|
if err != nil {
|
||||||
|
b.Fatalf("failed to create benchmark script: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.ResetTimer()
|
||||||
|
b.ReportAllocs()
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
_ = IsPushOnlyScript(script)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue