From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B2AC23858402 for ; Thu, 21 Dec 2023 22:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2AC23858402 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B2AC23858402 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703197456; cv=none; b=Wn6YY8zhhb1JfM/wxA/+9j0NA1QcPjp9SN0xFrzrUtSmmRoZQ2h9e/0+GVS5opR6BcO05Jz/557yMnos3s4Keg8ArWruu2TDyqtEhD99IFR0FXVhXkP5/klk0n7UFoSh/+MmmPEU2ajuF54ycOZYNpgdNxLW3w7+o9GzbryC6Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703197456; c=relaxed/simple; bh=/cydN7Mqr3xMJohxNSXrTpN8GfOfdXK8117Gt/gUUf4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ja3S6AA4p5mBoGfZR+GlkloJm9xinGmWhcz+gHxh0NbdIEMP1UfnYLob6uSiTdSOQI6ls3tXQ+hOj6AZ/ykzIj8c5h4zMjzAuA+hQwZmffYJpWcW3e8N2/G7FUt4rtuso1odtTr9kkPU9IZUg8oMWczDbwcAiA/mb7Jn+nsIQxM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703197455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nh5kyEySkDJKUur0osWuenao7wx1+FDq+RVUOo/eSvA=; b=Hk+hbyUKk6iQGwyxW5kSQYUHkg9i8xbP/FtjYbiU9649jYV0gW/DgQ3t23yD3cdx8udMKL C6ty1Su4knuORyLsCm6bR3k+iROOQWZ2/lLo1tRof4RWexoeOjDNZOA0gM2iKr9Skip8Dm tAPbNxdVK9c8FkNqpcMbdVpWybvMHO0= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-35-SsoOtUHCOEa1EGJ6uSyF7w-1; Thu, 21 Dec 2023 17:24:13 -0500 X-MC-Unique: SsoOtUHCOEa1EGJ6uSyF7w-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-5caf86963ecso19955907b3.3 for ; Thu, 21 Dec 2023 14:24:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703197453; x=1703802253; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nh5kyEySkDJKUur0osWuenao7wx1+FDq+RVUOo/eSvA=; b=j6Y+u6+u/di+uaJoY2Bu7Q7HMsz2R2mlUuR+IXcJ+c4zdhnQ4+MS9iCoGdMOw5RVwe rkXKJILSlBOSX6eh/GhG/fy6MFS404ZAxit/MDajhc4F8eURZFO3fFDzQM94Nq/ZNz2L gnaH/LMzbpCX/HWZ0VXoxDm4TRFb+uQFz1rVtDbVwyrhI1LLHVa9nTZsJ1HCZoRYwWey olh6lKVv0d1CGHStXZqO+vnKSSkzeRz06eUtqKcIjTdUcYLPMVc1K0IpoFd49qNoGdTg WUrk3fvPKu0N9v0dWjt5XggVV1KkEFaWD+z3tE/1vStPdNwyU1Dd1bTWWaMAypauQzcb zSrA== X-Gm-Message-State: AOJu0YyYDUTI8cHL2CQvpPBaOk6H3POd7qS3Nd6f/ufTH7Yb3vISB47T Ol3jISq9gviy2JJeDUTZOAcebN5UewJ2CLPKdf+r1AhJpw03DF57lcw17dw3yz6RNEx+eQdDHpn JMLyywzhWLhICqWyY+LhxHyUpIKTRp4YIfS/SFU1kTg== X-Received: by 2002:a81:8a42:0:b0:5d7:1940:7d69 with SMTP id a63-20020a818a42000000b005d719407d69mr522599ywg.64.1703197453369; Thu, 21 Dec 2023 14:24:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IELHzOqhyPOWC+YcI3sPo1NqO9XVxNClL5wGPlOeyj14+NsXFonH4iAgv8F+IBPCUjvNGtM65OIsZBvjlLiIdc= X-Received: by 2002:a81:8a42:0:b0:5d7:1940:7d69 with SMTP id a63-20020a818a42000000b005d719407d69mr522588ywg.64.1703197453123; Thu, 21 Dec 2023 14:24:13 -0800 (PST) MIME-Version: 1.0 References: <6472c80c-7ea1-427c-9046-d46fd1121f34@gmail.com> In-Reply-To: <6472c80c-7ea1-427c-9046-d46fd1121f34@gmail.com> From: Jonathan Wakely Date: Thu, 21 Dec 2023 22:23:57 +0000 Message-ID: Subject: Re: [PATCH 4/5][_Hashtable] Generalize the small size optimization To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 23 Nov 2023 at 22:00, Fran=C3=A7ois Dumont w= rote: > > libstdc++: [_Hashtable] Extend the small size optimization > > A number of methods were still not using the small size > optimization which > is to prefer an O(N) research to a hash computation as long as N is > small. > > libstdc++-v3/ChangeLog: > > * include/bits/hashtable.h: Move comment about all > equivalent values > being next to each other in the class documentation header. > (_M_reinsert_node, _M_merge_unique): Implement small size > optimization. > (_M_find_tr, _M_count_tr, _M_equal_range_tr): Likewise. > > Tested under Linux x64 > > Ok to commit ? Yes, this one seems safe to commit now. Thanks.