Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Compiled" static header maps instead of big trie #33932

Merged
merged 33 commits into from
May 23, 2024

Add compiled_string_map.md

56c5e4e
Select commit
Loading
Failed to load commit list.
Merged

"Compiled" static header maps instead of big trie #33932

Add compiled_string_map.md
56c5e4e
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/Android tests skipped May 17, 2024 in 0s

Check was skipped

This check was not triggered in this CI run

Details

Request (pr/33932/main@56c5e4e)

ravenblackx @ravenblackx 56c5e4e #33932 merge main@e1c31c3

"Compiled" static header maps instead of big trie

Commit Message: "Compiled" static header maps instead of big trie
Additional Description: This is slightly slower for "misses" but significantly faster for "hits". Given that the majority of headers are expected to be matches for the static table, this should be a big win. (Each faster hit pays for 30 slower misses!) This structure also uses significantly less memory than the big trie.

Performance benchmarks - bazel run -c opt test/common/http:header_map_impl_speed_test -- --benchmark_filter="bm*" --benchmark_repetitions=25 --benchmark_display_aggregates_only

Benchmark before after beforeStdDev afterStdDev change
bmHeaderMapImplRequestStaticLookupHits 47.2ns 16.4ns 0.629 0.378 -65.3%
bmHeaderMapImplResponseStaticLookupHits 34.7ns 14.3ns 0.571 0.085 -58.8%
bmHeaderMapImplRequestStaticLookupMisses 6.89ns 6.83ns 0.044 0.034 -0.01%
bmHeaderMapImplResponseStaticLookupMisses 6.40ns 7.31ns 0.028 0.057 +14.2%

Risk Level: Could be high since headers are parsed millions of times per second. But also there's a lot of existing test cases.
Testing: Added tests, existing tests involving headers will also provide coverage.
Docs Changes: n/a
Release Notes: Not yet
Platform Specific Features: n/a

Environment

Request variables

Key Value
ref fb5a879
sha 56c5e4e
pr 33932
base-sha e1c31c3
actor ravenblackx @ravenblackx
message "Compiled" static header maps instead of big trie...
started 1715962685.196405
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c
mobile envoyproxy/envoy-build-ubuntu:mobile-f94a38f62220a2b017878b790b6ea98a0f6c5f9c
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 31
patch 0
dev true