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

Function BenchmarkCountThresholdLteEarlyExit

optimizer/count_threshold_test.go:242–252  ·  view source on GitHub ↗

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

(b *testing.B)

Source from the content-addressed store, hash-verified

240
241// Benchmark: count <= N with early exit (result is false)
242func BenchmarkCountThresholdLteEarlyExit(b *testing.B) {
243 // All 10000 match, threshold is 51
244 // Should exit after ~51 iterations with result = false
245 program, _ := expr.Compile(`count(1..10000, # > 0) <= 50`)
246 var out any
247 b.ResetTimer()
248 for n := 0; n < b.N; n++ {
249 out, _ = vm.Run(program, nil)
250 }
251 _ = out
252}
253
254// Benchmark: count < N without early exit (result is true)
255func BenchmarkCountThresholdLtNoEarlyExit(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…