From ff69455469562eece7113ddb5acc64d5a408e2d0 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 30 May 2021 02:55:48 -0500 Subject: [PATCH] stdscript: Add v0 stake revoke p2sh benchmark. BenchmarkIsStakeRevocationScriptHashScript ------------------------------------------ v0_complex_non_standard 725635868 1.631 ns/op 0 allocs/op v0_stake_revoke_p2sh 522431919 2.571 ns/op 0 allocs/op This is part of a series of commits to fully implement the stdscript package. --- internal/staging/stdscript/script_bench_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/staging/stdscript/script_bench_test.go b/internal/staging/stdscript/script_bench_test.go index 880b0a22..60e5c15d 100644 --- a/internal/staging/stdscript/script_bench_test.go +++ b/internal/staging/stdscript/script_bench_test.go @@ -242,3 +242,13 @@ func BenchmarkIsStakeRevocationPubKeyHashScript(b *testing.B) { } benchIsX(b, filterFn, IsStakeRevocationPubKeyHashScript) } + +// BenchmarkIsStakeRevocationScriptHashScript benchmarks the performance of +// various public key scripts to determine if they are stake revocation p2sh +// scripts. +func BenchmarkIsStakeRevocationScriptHashScript(b *testing.B) { + filterFn := func(test scriptTest) bool { + return test.wantType == STStakeRevocationScriptHash + } + benchIsX(b, filterFn, IsStakeRevocationScriptHashScript) +}