From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8275 invoked by alias); 8 Nov 2012 02:26:34 -0000 Received: (qmail 8100 invoked by uid 55); 8 Nov 2012 02:26:16 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/54075] [4.7.1] unordered_map insert still slower than 4.6.2 Date: Thu, 08 Nov 2012 02:26: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: fdumont at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-11/txt/msg00689.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54075 --- Comment #43 from Paolo Carlini 2012-11-08 02:26:12 UTC --- On 11/08/2012 02:56 AM, Paolo Carlini wrote: > On the other hand, the old-old code for rehash didn't use > _M_growth_factor in these computations, it just literally enforced the > post-conditions of the Standard. Are we sure we aren't so to speak > rehashing too much? For example, when the load factor is very low and > doesn't count, it looks like a current rehash(n) accomplishes the same > of an old rehash(n * 2)?!? Something seems wrong, can you double check > that? In any case the comments before _M_next_bkt would need fixing. ... in other terms, I really think that the only uses of _S_growth_factor should return to be inside _M_need_rehash, because that's the function called by the inserts, when the container must automatically grow the number of buckets. Elsewhere, like the constructors, rehash, should not need to know about _S_growth_factor. Paolo.