From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DCD803982C36; Fri, 29 May 2020 11:13:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCD803982C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590750796; bh=ZM+IBLQwHsi1GqTCZU8XJxU3F+cNZQQJyNcgFjyo+u4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OI+75Pyd8yj1DfDXZZjdo5UdtNHksJ4bwHsEQPyUgBa2KE+08Kr2MVKQHhtuTf6jP /rD4ldh0pKVJpVnskJkHz6wtKcrAK63pMqHYorto+mhgwA2NehslqgdclghvbZPdnC /Q+s4suM+gusBrPZ5GpDvZvTNjjsMQKCjL67lb88= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95079] unorderd_map::insert_or_assign and try_emplace should only hash and mod once unless there is a rehash. Date: Fri, 29 May 2020 11:13:16 +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: 10.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: fdumont 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: Fri, 29 May 2020 11:13:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95079 --- Comment #3 from CVS Commits --- The master branch has been updated by Fran=C3=A0=C2=A4=C2=A5=C3=A0=C2=A4ois= Dumont : https://gcc.gnu.org/g:7688e5e8c4d46102a0cc0b9c25191ac7dde0d285 commit r11-719-g7688e5e8c4d46102a0cc0b9c25191ac7dde0d285 Author: Fran=C3=A7ois Dumont Date: Sun May 24 12:04:38 2020 +0200 libstdc++: Review unordered_map insert_or_assign/try_emplace (PR 95079) Those methods are making a double lookup in case of insertion, they can perform only one. PR libstdc++/95079 * include/bits/hashtable_policy.h (_Insert_base<>::try_emplace): New. * include/bits/unordered_map.h (unordered_map<>::try_emplace): Adapt. (unordered_map<>::insert_or_assign): Adapt.=