mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
txscript: Add benchmark for isAnyKindOfScriptHash.
This commit is contained in:
parent
51f76392b4
commit
bc56df1046
@ -223,3 +223,18 @@ func BenchmarkGetSigOpCount(b *testing.B) {
|
||||
_ = GetSigOpCount(script)
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkIsAnyKindOfScriptHash benchmarks how long it takes to
|
||||
// isAnyKindOfScriptHash to analyze operations of a very large script.
|
||||
func BenchmarkIsAnyKindOfScriptHash(b *testing.B) {
|
||||
script, err := genComplexScript()
|
||||
if err != nil {
|
||||
b.Fatalf("failed to create benchmark script: %v", err)
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
pops, _ := parseScript(script)
|
||||
_ = isAnyKindOfScriptHash(pops)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user