| 318 | } |
| 319 | |
| 320 | void BM_ParseAddressMatcherMatchesVar(benchmark::State& state) { |
| 321 | bool optimize = state.range(0); |
| 322 | auto runner = BenchmarkState::Create(optimize); |
| 323 | |
| 324 | ABSL_CHECK_OK(runner.status()); |
| 325 | |
| 326 | auto program = runner->MakeProgram( |
| 327 | "net.parseAddressMatcher('8.8.0.0-8.8.255.255').containsAddress(net." |
| 328 | "parseAddress(ip))"); |
| 329 | ABSL_CHECK_OK(program.status()); |
| 330 | |
| 331 | google::protobuf::Arena arena; |
| 332 | Activation activation; |
| 333 | activation.InsertOrAssignValue("ip", StringValue::From("8.8.4.4", &arena)); |
| 334 | for (auto s : state) { |
| 335 | auto result = (*program)->Evaluate(&arena, activation); |
| 336 | ABSL_CHECK_OK(result.status()); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | BENCHMARK(BM_ParseAddress)->Arg(0)->Arg(1); |
| 341 | BENCHMARK(BM_ParseAddressVar)->Arg(0)->Arg(1); |
nothing calls this directly
no test coverage detected