MCPcopy Create free account
hub / github.com/expr-lang/expr / BenchmarkCountThresholdLtEarlyExit

Function BenchmarkCountThresholdLtEarlyExit

optimizer/count_threshold_test.go:229–239  ·  view source on GitHub ↗

Benchmark: count < N with early exit (result is false)

(b *testing.B)

Source from the content-addressed store, hash-verified

227
228// Benchmark: count < N with early exit (result is false)
229func BenchmarkCountThresholdLtEarlyExit(b *testing.B) {
230 // All 10000 match, threshold is 100
231 // Should exit after ~100 iterations with result = false
232 program, _ := expr.Compile(`count(1..10000, # > 0) < 100`)
233 var out any
234 b.ResetTimer()
235 for n := 0; n < b.N; n++ {
236 out, _ = vm.Run(program, nil)
237 }
238 _ = out
239}
240
241// Benchmark: count <= N with early exit (result is false)
242func BenchmarkCountThresholdLteEarlyExit(b *testing.B) {

Callers

nothing calls this directly

Calls 2

CompileFunction · 0.92
RunFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…