stdscript: Add v0 treasury gen p2sh benchmark.

BenchmarkIsTreasuryGenScriptHashScript
--------------------------------------
v0_complex_non_standard       814816624   1.310 ns/op   0 allocs/op
v0_treasury_generation_p2sh   520297904   2.274 ns/op   0 allocs/op

This is part of a series of commits to fully implement the stdscript
package.
This commit is contained in:
Dave Collins 2021-05-30 02:55:57 -05:00
parent b058f88437
commit e31b426a2d
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -291,3 +291,13 @@ func BenchmarkIsTreasuryGenPubKeyHashScript(b *testing.B) {
}
benchIsX(b, filterFn, IsTreasuryGenPubKeyHashScript)
}
// BenchmarkIsTreasuryGenScriptHashScript benchmarks the performance of
// analyzing various public key scripts to determine if they are treasury
// generation p2sh scripts.
func BenchmarkIsTreasuryGenScriptHashScript(b *testing.B) {
filterFn := func(test scriptTest) bool {
return test.wantType == STTreasuryGenScriptHash
}
benchIsX(b, filterFn, IsTreasuryGenScriptHashScript)
}