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.133.124]) by sourceware.org (Postfix) with ESMTPS id C008A3858CDA for ; Tue, 4 Oct 2022 14:38:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C008A3858CDA 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=1664894300; 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=/u5Oq0yzaW4gjMbLoxgYWm1AwLgxbvNStNaV1e9VLa4=; b=QyWs6H3wnBRY6Pj5qvJs2MxFb1ZGoy2fXDY5+h/nOyULcw+XNBOwVNMrFs8n1wpZax1HFd uh9d3teepwwLOzrFim59ppMFf4pxDmROZJYZCELeEscx6QfgEZ9lE6wgCKian10GV5+wLg KU0/6x2fcy/w+pYIQ/uHzgpaShUnBos= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-510-n-LBu_HxPNq4z3-cRCBscA-1; Tue, 04 Oct 2022 10:38:19 -0400 X-MC-Unique: n-LBu_HxPNq4z3-cRCBscA-1 Received: by mail-qv1-f71.google.com with SMTP id dn14-20020a056214094e00b004b1a231394eso2567087qvb.13 for ; Tue, 04 Oct 2022 07:38:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=/u5Oq0yzaW4gjMbLoxgYWm1AwLgxbvNStNaV1e9VLa4=; b=4Ie3gVshfbd08jEik+rI1o9mNLcFKW7MrCOU251paw7Qw6w8bcqpEQalrYI5LLP7l/ fnj8YKyGAcyUcTrq4GpyKLRtvRxEd2KRUesEFqI/9Q2haZivqmmmD55zTlI5hUJSzEi4 9z5sk7Zov7qGFSzeNYTaQwpJqBDO1nCEIqn+0d8PS0d5/eh7wH6RtL/4pfh6XQGHmHil 4o7SkFLYkdkXJgnDzO8HOyZtEoHxX8Qs+8Bee694Kz2NP1MJPrX3+zyInRdQVFfzxXqC w23nvj8aqjins4H4EAENV6BEnB2IzyfEYMJoxT2J2oOilGPDify7I70POS5WYEvfbR7j mLEA== X-Gm-Message-State: ACrzQf10HrRrUPOChAhTa5HTYuiiqqA3HnDAHTvXMrPJQPNu0YaA6/zo GoxOkDi7WzmXIxK1Lj045LZT5PrjIsEtLs3BDs6yTK2dowiWsFoMpkubHyYiDMcZBUbL+fUuVXK 6B/VNMBeZl6rb6+8SvrpR/eOUT4J1qrnoaQ== X-Received: by 2002:a05:622a:408a:b0:35b:b5fa:5e32 with SMTP id cg10-20020a05622a408a00b0035bb5fa5e32mr19398092qtb.122.1664894298631; Tue, 04 Oct 2022 07:38:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6kQEq56BRckQ9IDBKVY9ZWnQL0eSZRieJ4VssYf8XHKuIOXpGd8nzUX1MQsJ/Uo0ulIaX1uQoamnVt0hDCfrI= X-Received: by 2002:a05:622a:408a:b0:35b:b5fa:5e32 with SMTP id cg10-20020a05622a408a00b0035bb5fa5e32mr19398078qtb.122.1664894298423; Tue, 04 Oct 2022 07:38:18 -0700 (PDT) MIME-Version: 1.0 References: <20221004011115.2009591-1-ppalka@redhat.com> <0c8cf283-5dc4-96a4-1bd7-7aa1ab71656f@idea> In-Reply-To: <0c8cf283-5dc4-96a4-1bd7-7aa1ab71656f@idea> From: Jonathan Wakely Date: Tue, 4 Oct 2022 15:38:07 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Implement ranges::join_with_view from P2441R2 To: Patrick Palka Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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, 4 Oct 2022 at 15:09, Patrick Palka wrote: > > On Tue, 4 Oct 2022, Jonathan Wakely wrote: > > > On Tue, 4 Oct 2022 at 02:11, Patrick Palka via Libstdc++ > > wrote: > > > > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? FWIW using > > > > OK, thanks. > > Thanks a lot, patch committed. > > > > > > variant<_PatternIter, _InnerIter> in the implementation means we need to > > > include from , which increases the preprocessed size > > > of by 3% (51.5k vs 53k). I suppose that's an acceptable cost? > > > > Yeah, I don't think we want to reimplement a lightweight std::variant, > > because that would just add even more code. > > Sounds good. > > > > > As I mentioned on IRC, maybe we could optimize the compilation time > > for some of the visitation using P2637R0, but that can be done later. > > Ah, I didn't consider the compile time impact of using std::visit. > Since we already use/instantiate std::get elsewhere in the implementation, > what do you think about doing the visitation manually via index() and > std::get like so? Seems to reduce compile time/memory usage for > join_with/1.cc by around 6% and doesn't look too messy since we're > dealing with only two alternatives. (And IIUC this should be equivalent > to std::visit wrt valueless_by_exception handling, since the call to > std::get<1> in each else branch will throw bad_variant_access for us > like std::visit would.) Nice, 6% seems worth it, and I agree it's not too messy. Please check this in too!