Skip to content

perf: more efficient header processing #120

@mattklein123

Description

@mattklein123

As part of recent profiling comparison with nginx:

Right now how Envoy handles headers is extremely inefficient. We use a list, along with std::string, and generally iterate over the entire list for remove operations, etc.

Move to a more efficient implementation that:

  • Looks at each header on receive and store direct pointer into the list if Envoy will ever use it (via hash lookup). All add/remove/modify operations become O(1).
  • Move away from std::string, implement explicit short string optimization, with sentinel for common headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions