INNER CODE UNIT · Go
Benchmark_envStruct_noEnv
expr-lang/expr · bench_test.go:269
func Benchmark_envStruct_noEnv(b *testing.B) {
type Price struct {
Value int
}
type Env struct {
Price Price
}
program, err := expr.Compile(`Price.Value > 0`)
require.NoError(b, err)
env := Env{Price: Price{Value: 1}}
var out any
b.ResetTimer()
for n := 0; n < b.N; n++ {
out, err = vm.Run(program, env)
}