Benchmark: count <= N with early exit (result is false)
(b *testing.B)
| 240 | |
| 241 | // Benchmark: count <= N with early exit (result is false) |
| 242 | func 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) |
| 255 | func BenchmarkCountThresholdLtNoEarlyExit(b *testing.B) { |