Benchmark: Large threshold with early match
(b *testing.B)
| 214 | |
| 215 | // Benchmark: Large threshold with early match |
| 216 | func BenchmarkCountThresholdLargeEarlyMatch(b *testing.B) { |
| 217 | // All 10000 match, threshold is 1000 |
| 218 | // Should exit after ~1000 iterations |
| 219 | program, _ := expr.Compile(`count(1..10000, # > 0) > 999`) |
| 220 | var out any |
| 221 | b.ResetTimer() |
| 222 | for n := 0; n < b.N; n++ { |
| 223 | out, _ = vm.Run(program, nil) |
| 224 | } |
| 225 | _ = out |
| 226 | } |
| 227 | |
| 228 | // Benchmark: count < N with early exit (result is false) |
| 229 | func BenchmarkCountThresholdLtEarlyExit(b *testing.B) { |