1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-10 05:22:59 +03:00

Make ThreadLocal *static*

Summary:
This was comically slow and wasteful

derpderp

Reviewed By: lnicco

Differential Revision: D19204351

fbshipit-source-id: 887f3605f6fbd1667e3c5866fb34409400d76e66
This commit is contained in:
Alan Frindell
2020-01-08 14:35:40 -08:00
committed by Facebook Github Bot
parent ad3dcd3dcb
commit 9733a79287
2 changed files with 3 additions and 3 deletions

View File

@@ -508,8 +508,8 @@ void HQStreamCodec::generateHeaderImpl(folly::IOBufQueue& writeBuf,
const HTTPMessage& msg,
folly::Optional<StreamID> pushId,
HTTPHeaderSize* size) {
folly::ThreadLocal<std::vector<std::string>> tempsTL;
folly::ThreadLocal<std::vector<compress::Header>> allHeadersTL;
static folly::ThreadLocal<std::vector<std::string>> tempsTL;
static folly::ThreadLocal<std::vector<compress::Header>> allHeadersTL;
auto& temps = *tempsTL.get();
auto& allHeaders = *allHeadersTL.get();
temps.clear();

View File

@@ -46,7 +46,7 @@ QPACKEncoder::EncodeResult QPACKCodec::encode(
vector<Header>& headers,
uint64_t streamId,
uint32_t maxEncoderStreamBytes) noexcept {
folly::ThreadLocal<std::vector<HPACKHeader>> preparedTL;
static folly::ThreadLocal<std::vector<HPACKHeader>> preparedTL;
auto& prepared = *preparedTL.get();
encodedSize_.uncompressed = compress::prepareHeaders(headers, prepared);
auto res = encoder_.encode(prepared, encodeHeadroom_, streamId,