Allocate memory less often in HttpHeaderBlock hash function

quiche::StringPieceCaseHash used a std::string to store the lower-cased version of the string to be hashed. This permitted 22 character header names to be hashed without memory allocation on 64-bit platforms, but the limit is much less on 32-bit platforms, which affects Chrome.

Instead, use an absl::FixedArray with internal storage sized for a cache line to store the temporary string. This should be enough to avoid heap allocation for any real-world header name.

Also add a unit test.

Not flag-protected as it is a low-risk optimization with no functional change.

PiperOrigin-RevId: 660691522
2 files changed
tree: 572908fb4e88991cafd3617cb87956178ae93504
  1. build/
  2. depstool/
  3. quiche/
  4. .bazelrc
  5. .bazelversion
  6. BUILD.bazel
  7. CONTRIBUTING.md
  8. LICENSE
  9. README.md
  10. WHITESPACE
  11. WORKSPACE.bazel
README.md

QUICHE

QUICHE stands for QUIC, Http, Etc. It is Google‘s production-ready implementation of QUIC, HTTP/2, HTTP/3, and related protocols and tools. It powers Google’s servers, Chromium, Envoy, and other projects. It is actively developed and maintained.

There are two public QUICHE repositories. Either one may be used by embedders, as they are automatically kept in sync:

To embed QUICHE in your project, platform APIs need to be implemented and build files need to be created. Note that it is on the QUICHE team's roadmap to include default implementation for all platform APIs and to open-source build files. In the meanwhile, take a look at open source embedders like Chromium and Envoy to get started:

To contribute to QUICHE, follow instructions at CONTRIBUTING.md.

QUICHE is only supported on little-endian platforms.