Skip to content

runtime: switching from unordered_map to absl::flat_hash_map#6389

Merged
lizan merged 3 commits intoenvoyproxy:masterfrom
alyssawilk:string_view
Mar 28, 2019
Merged

runtime: switching from unordered_map to absl::flat_hash_map#6389
lizan merged 3 commits intoenvoyproxy:masterfrom
alyssawilk:string_view

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

This allows us to move the new runtime APIs over to string_view without taking a string-serialization performance hit.

see https://abseil.io/docs/cpp/guides/container for flat_hash_map being a unordered_map replacement with heterogeneous lookup for string_view.

Risk Level: Medium (swapping the underlying internals of runtime)
Testing: existing tests pass
Docs Changes: no
Release Notes: no

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Member

@venilnoronha venilnoronha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w/ a nit. Thanks!


/**
* @return const std::unordered_map<std::string, Entry>& the values in this layer.
* @return const absl::flat_hash_ma<std::string, Entry>& the values in this layer.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/flat_hash_ma/flat_hash_map

p
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
venilnoronha
venilnoronha previously approved these changes Mar 26, 2019

MOCK_CONST_METHOD1(deprecatedFeatureEnabled, bool(const std::string& key));
MOCK_CONST_METHOD1(runtimeFeatureEnabled, bool(const std::string& key));
MOCK_CONST_METHOD1(runtimeFeatureEnabled, bool(const absl::string_view key));
Copy link
Copy Markdown
Member

@lizan lizan Mar 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no top-level const parameter (which has no effect on signature so compiler doesn't complain)

@lizan lizan added the waiting label Mar 27, 2019
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@lizan lizan merged commit 845f837 into envoyproxy:master Mar 28, 2019
spenceral added a commit to spenceral/envoy that referenced this pull request Mar 29, 2019
* master:
  router: support prefix wildcards in virtual hosts domains (envoyproxy#6303)
  security: update distributor application example to include e-mail. (envoyproxy#6425)
  Examples: Update gen script of grpc example service (envoyproxy#6372)
  config: de-templatize source/common/config (envoyproxy#6391)
  docs: adds information about the Envoy tracer from Instana envoyproxy#6371 (envoyproxy#6416)
  test: convert ratelimit test configs to v2 YAML (envoyproxy#6411)
  include required python and go dependencies for grpc-bridge example (envoyproxy#6402)
  docs: more snapping fixes (envoyproxy#6404)
  runtime: switching from unordered_map to absl::flat_hash_map (envoyproxy#6389)
@alyssawilk alyssawilk deleted the string_view branch July 31, 2019 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants