Change HeaderTable::names_map values to a small_vectormaster
commit3eecda0cd6271e1e3a3f532d9092bddbb060ec22
authorMatt Joras <mjoras@meta.com>
Mon, 3 Jun 2024 01:50:07 +0000 (2 18:50 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 3 Jun 2024 01:50:07 +0000 (2 18:50 -0700)
treea255ca28bdbff06917cbc64c25add0030505bcf5
parent40763e9e106faa4867ef6a3c3be9d1955f804f45
Change HeaderTable::names_map values to a small_vector

Summary:
std::list is generally a bad choice, and this one is particularly bad for performance. Each iteration in getIndex essentially incurs a cache miss, which under load can be going all the way to DRAM.

Change the map to always a (flat) F14ValueMap, and optimize further by having the values inline most of the time. 7 is chosen as an empirically good value, while not being outrageously large.

Reviewed By: kvtsoy

Differential Revision: D58037451

fbshipit-source-id: 7a546aa00cab65c95a2ee1c25a79a45caa71c774
third-party/proxygen/src/proxygen/lib/http/codec/HTTP1xCodec.h
third-party/proxygen/src/proxygen/lib/http/codec/compress/HeaderTable.cpp
third-party/proxygen/src/proxygen/lib/http/codec/compress/HeaderTable.h
third-party/proxygen/src/proxygen/lib/http/codec/compress/test/HPACKContextTests.cpp