Benchmark: count > 100 with no early exit (not enough matches)
(b *testing.B)
| 201 | |
| 202 | // Benchmark: count > 100 with no early exit (not enough matches) |
| 203 | func 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 |
| 216 | func BenchmarkCountThresholdLargeEarlyMatch(b *testing.B) { |