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

Function BenchmarkCountThresholdNoEarlyExit

optimizer/count_threshold_test.go:203–213  ·  view source on GitHub ↗

Benchmark: count > 100 with no early exit (not enough matches)

(b *testing.B)

Source from the content-addressed store, hash-verified

201
202// Benchmark: count > 100 with no early exit (not enough matches)
203func BenchmarkCountThresholdNoEarlyExit(b *testing.B) {
204 // Only 100 elements match (# <= 100), threshold is 101
205 // Must scan entire array
206 program, _ := expr.Compile(`count(1..10000, # <= 100) > 100`)
207 var out any
208 b.ResetTimer()
209 for n := 0; n < b.N; n++ {
210 out, _ = vm.Run(program, nil)
211 }
212 _ = out
213}
214
215// Benchmark: Large threshold with early match
216func BenchmarkCountThresholdLargeEarlyMatch(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…