18 using namespace folly;
23 return encoder.
encode(headers);
28 unique_ptr<IOBuf> encoded =
encode(headers, encoder);
38 vector<HPACKHeader> headers;
39 headers.emplace_back(
":authority",
"www.facebook.com");
40 headers.emplace_back(
":method",
"GET");
41 headers.emplace_back(
":path",
"/graphql");
42 headers.emplace_back(
":scheme",
"https");
45 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 " 46 "(KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36");
47 headers.emplace_back(
"accept-encoding",
"gzip, deflate, br");
48 headers.emplace_back(
"accept-language",
"en-US,en;q=0.8");
51 "text/html,application/xhtml+xml,application/xml;q=0.9,image/" 52 "webp,image/apng,*/*;q=0.8");
57 static vector<HPACKHeader> headers =
getHeaders();
61 for (
int i = 0;
i < iters;
i++) {
64 for (
int j = 0; j < reencodes; j++) {
71 for (
int i = 0;
i < iters;
i++) {
75 for (
int j = 0; j < reencodes; j++) {
106 gflags::ParseCommandLineFlags(&argc, &argv,
true);
unique_ptr< IOBuf > encode(vector< HPACKHeader > &headers, HPACKEncoder &encoder)
—— Concurrent Priority Queue Implementation ——
vector< HPACKHeader > getHeaders()
void encodeBench(int reencodes, int iters)
void decodeStreaming(folly::io::Cursor &cursor, uint32_t totalBytes, HPACK::StreamingCallback *streamingCb)
std::unique_ptr< folly::IOBuf > encode(const std::vector< HPACKHeader > &headers, uint32_t headroom=0)
void encodeDecodeBench(int reencodes, int iters)
void encodeDecode(vector< HPACKHeader > &headers, HPACKEncoder &encoder, HPACKDecoder &decoder)
int main(int argc, char **argv)