WIP: next hard fork #5
1 changed files with 18 additions and 0 deletions
|
@ -438,3 +438,21 @@ func BenchmarkGetScriptClass(b *testing.B) {
|
||||||
_ = GetScriptClass(script)
|
_ = GetScriptClass(script)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BenchmarkPushedData benchmarks how long it takes to extract the pushed data
|
||||||
|
// from a very large script.
|
||||||
|
func BenchmarkPushedData(b *testing.B) {
|
||||||
|
script, err := genComplexScript()
|
||||||
|
if err != nil {
|
||||||
|
b.Fatalf("failed to create benchmark script: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
b.ResetTimer()
|
||||||
|
b.ReportAllocs()
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
_, err := PushedData(script)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue