MCPcopy Create free account
hub / github.com/btcsuite/btcd / BenchmarkIsPayToScriptHash

Function BenchmarkIsPayToScriptHash

txscript/bench_test.go:167–178  ·  view source on GitHub ↗

BenchmarkIsPayToScriptHash benchmarks how long it takes IsPayToScriptHash to analyze a very large script.

(b *testing.B)

Source from the content-addressed store, hash-verified

165// BenchmarkIsPayToScriptHash benchmarks how long it takes IsPayToScriptHash to
166// analyze a very large script.
167func BenchmarkIsPayToScriptHash(b *testing.B) {
168 script, err := genComplexScript()
169 if err != nil {
170 b.Fatalf("failed to create benchmark script: %v", err)
171 }
172
173 b.ResetTimer()
174 b.ReportAllocs()
175 for i := 0; i < b.N; i++ {
176 _ = IsPayToScriptHash(script)
177 }
178}
179
180// BenchmarkIsMultisigScriptLarge benchmarks how long it takes IsMultisigScript
181// to analyze a very large script.

Callers

nothing calls this directly

Calls 2

genComplexScriptFunction · 0.85
IsPayToScriptHashFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…