| 51 | } |
| 52 | |
| 53 | void FindHeaderMoreRealisticUseCase(benchmark::State& state) { |
| 54 | TString requestHeaders(R"(Host: yandex.ru |
| 55 | User-Agent: Mozilla/5.0 ... |
| 56 | Accept: */* |
| 57 | Accept-Language: en-US,en;q=0.5 |
| 58 | Accept-Encoding: gzip, deflate, br |
| 59 | Content-Type: text/plain;charset=UTF-8 |
| 60 | Content-Length: 1234 |
| 61 | Origin: https://a.yandex-team.ru |
| 62 | Connection: keep-alive |
| 63 | Referer: https://a.yandex-team.ru/ |
| 64 | Sec-Fetch-Dest: empty |
| 65 | Sec-Fetch-Mode: no-cors |
| 66 | Sec-Fetch-Site: cross-site |
| 67 | TE: trailers)"); |
| 68 | TStringInput stream(requestHeaders); |
| 69 | THttpHeaders headers(&stream); |
| 70 | Y_ENSURE(headers.FindHeader("Content-Type")); |
| 71 | for (auto _ : state) { |
| 72 | auto header = headers.FindHeader("Content-Type"); |
| 73 | benchmark::DoNotOptimize(header); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | BENCHMARK(FindHeaderFirstMatch); |
| 78 | BENCHMARK(FindHeaderNoMatchSameSize); |
nothing calls this directly
no test coverage detected