github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/core/fee/opcode_test.go (about)

     1  package fee
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
     7  )
     8  
     9  const feeFactor = 30
    10  
    11  // The most common Opcode() use case is to get price for a single opcode.
    12  func BenchmarkOpcode1(t *testing.B) {
    13  	// Just so that we don't always test the same opcode.
    14  	script := []opcode.Opcode{opcode.NOP, opcode.ADD, opcode.SYSCALL, opcode.APPEND}
    15  	l := len(script)
    16  	for n := 0; n < t.N; n++ {
    17  		_ = Opcode(feeFactor, script[n%l])
    18  	}
    19  }