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

Function BenchmarkCountThresholdLargeEarlyMatch

optimizer/count_threshold_test.go:216–226  ·  view source on GitHub ↗

Benchmark: Large threshold with early match

(b *testing.B)

Source from the content-addressed store, hash-verified

214
215// Benchmark: Large threshold with early match
216func BenchmarkCountThresholdLargeEarlyMatch(b *testing.B) {
217 // All 10000 match, threshold is 1000
218 // Should exit after ~1000 iterations
219 program, _ := expr.Compile(`count(1..10000, # > 0) > 999`)
220 var out any
221 b.ResetTimer()
222 for n := 0; n < b.N; n++ {
223 out, _ = vm.Run(program, nil)
224 }
225 _ = out
226}
227
228// Benchmark: count < N with early exit (result is false)
229func BenchmarkCountThresholdLtEarlyExit(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…