MCPcopy
hub / github.com/expr-lang/expr / Benchmark_largeNestedArrayAccess

Function Benchmark_largeNestedArrayAccess

bench_test.go:480–500  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

478}
479
480func Benchmark_largeNestedArrayAccess(b *testing.B) {
481 type Env struct {
482 Data [1][1024 * 1024 * 10]byte
483 }
484
485 program, err := expr.Compile(`Data[0][0] > 0`, expr.Env(Env{}))
486 require.NoError(b, err)
487
488 env := Env{}
489 env.Data[0][0] = 1
490
491 var out any
492 b.ResetTimer()
493 for n := 0; n < b.N; n++ {
494 out, err = vm.Run(program, &env)
495 }
496 b.StopTimer()
497
498 require.NoError(b, err)
499 require.True(b, out.(bool))
500}
501
502func Benchmark_sort(b *testing.B) {
503 env := map[string]any{

Callers

nothing calls this directly

Calls 5

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
TrueFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…