github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/vm/opcode/isvalid_test.go (about)

     1  package opcode
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  // IsValid() is called for every VM instruction.
     8  func BenchmarkIsValid(t *testing.B) {
     9  	// Just so that we don't always test the same opcode.
    10  	script := []Opcode{NOP, ADD, SYSCALL, APPEND, 0xff, 0xf0}
    11  	l := len(script)
    12  	for n := 0; n < t.N; n++ {
    13  		_ = IsValid(script[n%l])
    14  	}
    15  }