[
https://issues.apache.org/jira/browse/MESOS-4561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125227#comment-15125227
]
Michael Park commented on MESOS-4561:
-------------------------------------
[~haosdent] No, I'm saying that we should investigate why the natural use of
{{operator==}} causes temporary string constructions when they shouldn't. I
explicitly don't want to have to pull them out to a static string like in
[5e618ac|https://github.com/apache/mesos/commit/5e618ac2197e856f09511850bebe51fea71c1844],
nor have to use {{std::string::compare}}.
> Investigate `std::string` to C string comparison.
> -------------------------------------------------
>
> Key: MESOS-4561
> URL: https://issues.apache.org/jira/browse/MESOS-4561
> Project: Mesos
> Issue Type: Bug
> Reporter: Michael Park
> Labels: mesosphere
>
> [~jvanremoortere] identified a large performance bottleneck in role
> validation logic and submitted a
> [fix|https://github.com/apache/mesos/commit/5e618ac2197e856f09511850bebe51fea71c1844]
> for the 0.27.0 release.
> However, templated versions of {{bool operator==(const std::string&, const
> char \*)}} and {{bool operator==(const char\*, const std::string&)}} are part
> of the standard library
> http://en.cppreference.com/w/cpp/string/basic_string/operator_cmp, and
> therefore should not have triggered temporary string constructions.
> The first thought was perhaps they don't happen to be implemented in
> {{libstdc++}}, but having looked at its implementation, I was able to find
> the definitions of these operators.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)