stdscript: Add v0 stake change p2sh benchmark.

BenchmarkIsStakeChangeScriptHash
--------------------------------
v0_complex_non_standard   688796947   1.626 ns/op   0 allocs/op
v0_stake_change_p2sh      503956689   2.282 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:52 -05:00
parent 3e10162c52
commit 96a2bc60f6
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -262,3 +262,13 @@ func BenchmarkIsStakeChangePubKeyHash(b *testing.B) {
}
benchIsX(b, filterFn, IsStakeChangePubKeyHashScript)
}
// BenchmarkIsStakeChangeScriptHash benchmarks the performance of analyzing
// various public key scripts to determine if they are stake change p2sh
// scripts.
func BenchmarkIsStakeChangeScriptHash(b *testing.B) {
filterFn := func(test scriptTest) bool {
return test.wantType == STStakeChangeScriptHash
}
benchIsX(b, filterFn, IsStakeChangeScriptHashScript)
}