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

Function BenchmarkCountThresholdGteEarlyMatch

optimizer/count_threshold_test.go:190–200  ·  view source on GitHub ↗

Benchmark: count >= 50 with early match

(b *testing.B)

Source from the content-addressed store, hash-verified

188
189// Benchmark: count >= 50 with early match
190func BenchmarkCountThresholdGteEarlyMatch(b *testing.B) {
191 // All elements match, threshold is 50
192 // Should exit after ~50 iterations
193 program, _ := expr.Compile(`count(1..10000, # > 0) >= 50`)
194 var out any
195 b.ResetTimer()
196 for n := 0; n < b.N; n++ {
197 out, _ = vm.Run(program, nil)
198 }
199 _ = out
200}
201
202// Benchmark: count > 100 with no early exit (not enough matches)
203func BenchmarkCountThresholdNoEarlyExit(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…