This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/14061] poor performance of std::sort on large lexicographic c-string sort


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;
  }
};


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]