From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 778DE3856DC0; Wed, 13 Jul 2022 16:28:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 778DE3856DC0 From: "cuzdav at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106275] unordered_map with std::string key, std::hash, and custom equality predicate weirdness Date: Wed, 13 Jul 2022 16:28:27 +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: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cuzdav at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2022 16:28:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106275 --- Comment #6 from Chris Uzdavinis --- Thank you for the information. If the equality comparison function is slow enough, the large number of extra calls may not be an optimization.=20=20 While looking into it, the vastly different runtime behavior of it jumped o= ut to me as an indication of a problem, and seemed to be the answer to why internal tests drew my attention to this in the first place. (Behavior is normal without this optimization, but tests complained with it.) But now I understand it better, being a combination of the new behavior and characteristics of the custom predicate in "real code" of which this is a minimization. The extra calls are a symptom, not a cause.=