Skip to content

std::string is replaced with absl::string_view in test for performance reasons.#11568

Closed
yashwant121 wants to merge 0 commit into
envoyproxy:masterfrom
yashwant121:clutter_remove
Closed

std::string is replaced with absl::string_view in test for performance reasons.#11568
yashwant121 wants to merge 0 commit into
envoyproxy:masterfrom
yashwant121:clutter_remove

Conversation

@yashwant121
Copy link
Copy Markdown

A lot of the overhead std::string calls are replaced with absl::string_view
See #11287 for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is undefined behavior. with_comma will be referencing dangling pointer on the line below. The ASAN run will likely fail after you fix format problem. Also there is no performance gain in doing this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same thing here, undefined behavior.

@yanavlasov
Copy link
Copy Markdown
Contributor

Quick look through the PR show a few instances of undefined behavior. Please run ASAN build on your change and address the problems it reports. A few of these changes need to reverted.

Copy link
Copy Markdown
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

In general it should be safe to change formal-params to a function from string to string_view. However I think some of the other changes you've made look troublesome, per @yanavlasov's comments.

Comment thread test/test_common/utility.h Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this looks suspicious.

@jmarantz
Copy link
Copy Markdown
Contributor

/wait

@yanavlasov yanavlasov self-assigned this Jun 15, 2020
@asraa
Copy link
Copy Markdown
Contributor

asraa commented Jun 16, 2020

Nice!!
Just a drive-by. The issue also meant to address some instances of casting a string-view to a string in a param that are unneeded, see #11287 (comment)

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