2020-12-29 21:42:34 +00:00
|
|
|
package fee
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
|
|
|
|
)
|
|
|
|
|
|
|
|
const feeFactor = 30
|
|
|
|
|
2022-04-20 18:30:09 +00:00
|
|
|
// The most common Opcode() use case is to get price for a single opcode.
|
2020-12-29 21:42:34 +00:00
|
|
|
func BenchmarkOpcode1(t *testing.B) {
|
|
|
|
// Just so that we don't always test the same opcode.
|
|
|
|
script := []opcode.Opcode{opcode.NOP, opcode.ADD, opcode.SYSCALL, opcode.APPEND}
|
|
|
|
l := len(script)
|
2024-08-30 18:41:02 +00:00
|
|
|
for n := range t.N {
|
2020-12-29 21:42:34 +00:00
|
|
|
_ = Opcode(feeFactor, script[n%l])
|
|
|
|
}
|
|
|
|
}
|