This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14061] poor performance of std::sort on large lexicographic c-string sort
- From: "jdcoxm3 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 27 Mar 2015 17:51:06 +0000
- Subject: [Bug libstdc++/14061] poor performance of std::sort on large lexicographic c-string sort
- Auto-submitted: auto-generated
- References: <bug-14061-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14061
jdcoxm3 at hotmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jdcoxm3 at hotmail dot com
--- Comment #4 from jdcoxm3 at hotmail dot com ---
I ran into nearly the same issue and submitted a bug on this. Add a check to
you compare function as a work around.
struct functor_cmp {
bool operator()(const char* a, const char* b){
if (a == b) return false;
if( (++cmpcount)%100000 == 0 ) std::cerr << cmpcount << std::endl;
return strcmp(a,b) == -1;
}
};