From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7384 invoked by alias); 27 Mar 2015 17:51:10 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7336 invoked by uid 48); 27 Mar 2015 17:51:07 -0000 From: "jdcoxm3 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/14061] poor performance of std::sort on large lexicographic c-string sort Date: Fri, 27 Mar 2015 18:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 3.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jdcoxm3 at hotmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg03225.txt.bz2 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; } };