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 E1C1F382FD9C for ; Tue, 30 Aug 2022 20:07:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1C1F382FD9C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661890072; 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: in-reply-to:in-reply-to:references:references; bh=QWQOG9me9QXcSr2k6KKTqbwzXtE3Qr5vdjUHguM24L4=; b=SkDavCBksyFeTCs1WAw/Zknvt8ZLrCaBTgpUUasq5miYXr3lnwAMNVhuK8SlpEWb5ume7x cRCKq5zwEN3t4nrpLtc4hWrJWyi8WorwyH6K2QI+6Yar5zPADWbA4T65xewRqzQU1oPPQL GP4lRkNFFL0iWWgjelvBifEOf3M7Les= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-609-2i9RsJ4eP8OupCz9CNqPJA-1; Tue, 30 Aug 2022 16:07:51 -0400 X-MC-Unique: 2i9RsJ4eP8OupCz9CNqPJA-1 Received: by mail-qk1-f200.google.com with SMTP id az11-20020a05620a170b00b006bc374c71e8so10100223qkb.17 for ; Tue, 30 Aug 2022 13:07:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=QWQOG9me9QXcSr2k6KKTqbwzXtE3Qr5vdjUHguM24L4=; b=P8ZIBGdgCzFEZNUxXU+w2hheNQzcHWHKbJ3qYG/p8AwampYRD28EVO/3duieyvW0f6 +xoUzzjYSa9aj7FhEw7HQDWIAE9eYQYF0YHR0N196HOUR5qp81UXMVKHMnHodZvIADzD bL/ESbBlnzzXVaqeWwS5F1UL5eO2VxBk13mlt/1e8N/AEp5EzWCCIJnBNbUEPrGBUunm lsMod5I7mduMXSgd7AqXzI5nGSQCbPeXVGhhzj5hZ6tUtURya770UZhTZaq8oqK1xPK6 aX7wzMrtOgFadqrYXmk8NWykny9IDQgbxuLwZbinW+vP8ip5+ESYPMDwkj0RN2ftD3FJ XGMA== X-Gm-Message-State: ACgBeo1Y0bFagaObFDzcUTl6C7GBh6xZozgzeltmRqEBJKH+mPsZ7tOZ VmuALBc58Oi0gbEoYht7TWEi5vUCWqx9/jwKMTFMZEgHocCvWq9+crT0/D284Qne60M8avQsQhk N64i4guU= X-Received: by 2002:a05:6214:234b:b0:499:1268:b324 with SMTP id hu11-20020a056214234b00b004991268b324mr3560694qvb.42.1661890070881; Tue, 30 Aug 2022 13:07:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uwIFqqoupsfQnayVL6wZvcigdrYOIJSfy0x81MnrNJ2ezkn5Ea4hubsxD1mI8WgAjHMRHpQ== X-Received: by 2002:a05:6214:234b:b0:499:1268:b324 with SMTP id hu11-20020a056214234b00b004991268b324mr3560682qvb.42.1661890070662; Tue, 30 Aug 2022 13:07:50 -0700 (PDT) Received: from redhat.com ([2601:184:4780:4310::e531]) by smtp.gmail.com with ESMTPSA id w6-20020a05620a424600b006be8713f742sm5114326qko.38.2022.08.30.13.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 13:07:49 -0700 (PDT) Date: Tue, 30 Aug 2022 16:07:48 -0400 From: Marek Polacek To: Tim Lange Cc: GCC Mailing List Subject: Re: Usage of the C++ stdlib unordered_map in GCC Message-ID: References: <942GHR.WGPY8O255349@tim-lange.me> MIME-Version: 1.0 In-Reply-To: <942GHR.WGPY8O255349@tim-lange.me> User-Agent: Mutt/2.2.6 (2022-06-05) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Aug 30, 2022 at 09:57:45PM +0200, Tim Lange wrote: > Hello, > > I was preparing a patch for GCC and used the unordered_map from the C++ > stdlib in my patch. Later on, I noticed that it is used nowhere else inside > GCC except for some files in the go frontend. > > I wondered, now that building GCC requires a C++11 host compiler, whether > there is a consensus on which data structure implementation is preferred. > Should I rather use a hash_map instead of an unordered_map or is it on my > side to decide which one I choose? I think you're probably better off using a hash_map; std::unordered_map has efficiency issues as described in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2028r0.pdf Marek