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

Function BenchmarkIsPushOnlyScript

txscript/bench_test.go:275–286  ·  view source on GitHub ↗

BenchmarkIsPushOnlyScript benchmarks how long it takes IsPushOnlyScript to analyze a very large script.

(b *testing.B)

Source from the content-addressed store, hash-verified

273// BenchmarkIsPushOnlyScript benchmarks how long it takes IsPushOnlyScript to
274// analyze a very large script.
275func BenchmarkIsPushOnlyScript(b *testing.B) {
276 script, err := genComplexScript()
277 if err != nil {
278 b.Fatalf("failed to create benchmark script: %v", err)
279 }
280
281 b.ResetTimer()
282 b.ReportAllocs()
283 for i := 0; i < b.N; i++ {
284 _ = IsPushOnlyScript(script)
285 }
286}
287
288// BenchmarkIsWitnessPubKeyHash benchmarks how long it takes to analyze a very
289// large script to determine if it is a standard witness pubkey hash script.

Callers

nothing calls this directly

Calls 2

genComplexScriptFunction · 0.85
IsPushOnlyScriptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…