txscript: Add bench for stake submission scripts.
This commit is contained in:
parent
63e74185cf
commit
6de8d6901d
@ -362,3 +362,18 @@ func BenchmarkIsNullDataScript(b *testing.B) {
|
||||
_ = isNullDataScript(scriptVersion, script)
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkIsStakeSubmissionScript benchmarks how long it takes to analyze a
|
||||
// very large script to determine if it is a standard stake submission script.
|
||||
func BenchmarkIsStakeSubmissionScript(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)
|
||||
_ = isStakeSubmission(pops)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user