Removes unnecessary pointer indirection from a member of DelegatingStreamFilter#44652
Removes unnecessary pointer indirection from a member of DelegatingStreamFilter#44652birenroy wants to merge 3 commits into
Conversation
…reamFilter. Signed-off-by: Biren Roy <birenroy@google.com>
Signed-off-by: Biren Roy <birenroy@google.com>
Signed-off-by: Biren Roy <birenroy@google.com>
|
/assign @adisuissa |
adisuissa
left a comment
There was a problem hiding this comment.
Thanks, overall LGTM, but wanted to highlight the memory tradeoffs and see that it was intentional.
| Envoy::Http::StreamFilterBase* base_filter_{}; | ||
|
|
||
| std::unique_ptr<Envoy::Http::Matching::HttpMatchingDataImpl> matching_data_; | ||
| absl::optional<Envoy::Http::Matching::HttpMatchingDataImpl> matching_data_; |
There was a problem hiding this comment.
Pointing out, to make sure it was intentional:
This will now have a larger memory footprint than the unique_ptr.
There was a problem hiding this comment.
+1, even though optional has better runtime performance: more cache friendly and no heap allocation, it has bigger size which is this PR aims to?
Also, it disables assignment operator= since HttpMatchingDataImpl has reference member i.e. future usage flexibility
| Envoy::Http::StreamFilterBase* base_filter_{}; | ||
|
|
||
| std::unique_ptr<Envoy::Http::Matching::HttpMatchingDataImpl> matching_data_; | ||
| absl::optional<Envoy::Http::Matching::HttpMatchingDataImpl> matching_data_; |
There was a problem hiding this comment.
+1, even though optional has better runtime performance: more cache friendly and no heap allocation, it has bigger size which is this PR aims to?
Also, it disables assignment operator= since HttpMatchingDataImpl has reference member i.e. future usage flexibility
|
/wait |
We have noticed that these filters are using more memory than expected. This is one attempt to slightly reduce the cost.
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features: