Skip to content

Design document for the new field and head containers #282

Description

@ashtum

The containers in the burl project are improved versions of those in this project. We need a design document that explains the rationale behind each change.

The document should include (not limited to) changes like:

  • The 256-byte metadata blob is gone. Container types are now 10× smaller: fields container is 32 bytes instead of 336 bytes.
  • Framing metadata is now cached directly in the request and response containers as a lightweight 16-byte state, allowing observers such as response::keep_alive() and response::content_length() to run in O(1).
  • Parsed messages and user-constructed messages share the exact same cached framing metadata. The parser populates and consults this cache while parsing, enabling malformed message frames to be detected without reiterating the header fields.
  • Lookup table entries have been reduced from 20 bytes to 12 bytes, cutting table overhead by 40%.
  • fields_base no longer knows about message framing. All framing state now lives in message_head_base, separating generic field storage from HTTP message semantics.
  • head_parser enables incremental, in-place header parsing and handles all of the buffer juggling. It is the same component used by the library's parser, allowing users to build custom parsers on top of the exact same implementation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions