14 using namespace folly;
30 std::vector<HTTPHeaderCode> getTestHeaderCodes() {
31 std::vector<HTTPHeaderCode> testHeaderCodes;
33 j < HTTPCommonHeaders::num_header_codes; ++j) {
34 testHeaderCodes.push_back(static_cast<HTTPHeaderCode>(j));
36 return testHeaderCodes;
39 std::vector<const std::string *> getTestHeaderStrings() {
40 std::vector<const std::string *> testHeaderStrings;
42 j < HTTPCommonHeaders::num_header_codes; ++j) {
43 testHeaderStrings.push_back(
44 HTTPCommonHeaders::getPointerToHeaderName(
45 static_cast<HTTPHeaderCode>(j)));
47 return testHeaderStrings;
53 static const std::vector<HTTPHeaderCode> testHeaderCodes = getTestHeaderCodes();
55 static const std::vector<const std::string *> testHeaderStrings =
56 getTestHeaderStrings();
61 for (
int i = 0;
i < iters; ++
i) {
62 for (
auto const& testHeaderString: testHeaderStrings) {
63 HTTPCommonHeaders::hash(*testHeaderString);
69 for (
int i = 0;
i < iters; ++
i) {
71 j < HTTPCommonHeaders::num_header_codes; ++j) {
72 HTTPCommonHeaders::getHeaderCodeFromTableCommonHeaderName(
82 BENCHMARK(HTTPCommonHeadersGetHeaderCodeFromTableCommonHeaderName, iters) {
87 for (
int i = 0;
i < iters; ++
i) {
89 j < HTTPCommonHeaders::num_header_codes; ++j) {
93 testHeaderCodes.size()) !=
nullptr);
99 for (
int i = 0;
i < iters; ++
i) {
101 j < HTTPCommonHeaders::num_header_codes; ++j) {
102 auto address = HTTPCommonHeaders::getPointerToHeaderName(
103 static_cast<HTTPHeaderCode>(j));
106 testHeaderStrings.begin(), testHeaderStrings.end(), address) !=
107 testHeaderStrings.end());
121 gflags::ParseCommandLineFlags(&argc, &argv,
true);
—— Concurrent Priority Queue Implementation ——
BENCHMARK(fbFollyGlobalBenchmarkBaseline)
const uint8_t HTTPHeaderCodeCommonOffset