Benchmark: count < N with early exit (result is false)
(b *testing.B)
| 227 | |
| 228 | // Benchmark: count < N with early exit (result is false) |
| 229 | func 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) |
| 242 | func BenchmarkCountThresholdLteEarlyExit(b *testing.B) { |