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

server: Move a few internal APIs from std::string to absl::string_view. #2889

Merged
merged 3 commits into from
Mar 25, 2018

Conversation

jmarantz
Copy link
Contributor

Signed-off-by: Joshua Marantz jmarantz@google.com

Description: Changes a few internal interfaces from std::string to absl::string_view, reducing the number of temporary allocations and memcpys that must be made.

Risk Level: Low

Testing: //test/..., tsan, asan, msan (sanitizers in progress)

Release Notes: N/A

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@zuercher
Copy link
Member

@ggreenway can you take a first pass at this?

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz closed this Mar 23, 2018
@jmarantz jmarantz reopened this Mar 23, 2018
Copy link
Contributor

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

I think this looks good. One spot to potentially push deeper, but other than that LGTM.

Buffer::Instance& response) {
Http::Utility::QueryParams query_params = Http::Utility::parseQueryString(url);
Http::Utility::QueryParams query_params = Http::Utility::parseQueryString(std::string(url));
Copy link
Contributor

Choose a reason for hiding this comment

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

You can avoid this conversion/allocation if you push one level deeper into this function. I think it would be straightforward without affecting other functions, at least at first glance. But up to you if you want to do that or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I didn't need that construction. Good catch.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks!

@htuch htuch merged commit 833769c into envoyproxy:master Mar 25, 2018
@jmarantz jmarantz deleted the post-admin-mutations branch March 26, 2018 03:13
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.

4 participants