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 7A8D13858406 for ; Tue, 4 Oct 2022 14:38:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A8D13858406 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=1664894305; 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=KqfFxra0jMy5/G+KWwzBkZbox5qjCzGjwMAgs8YUj+dNULdtVkqfLXgZAhaMPGrFffcb47 kaoFWtLt2jm73ip0A7a2VXCQbydBKA7lQL7GdNpof2/f0ueGecl9AEkthUXwRIGZ7JU2QM bImB5iz9AQgClOzCKRPb0Bw1UJsnfp4= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-459-i7QGWPftPtCcYU0IMdjWyA-1; Tue, 04 Oct 2022 10:38:19 -0400 X-MC-Unique: i7QGWPftPtCcYU0IMdjWyA-1 Received: by mail-qk1-f199.google.com with SMTP id az15-20020a05620a170f00b006cece4cd0beso11906162qkb.22 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=lZASEpsR2cbM63KNwnXjOyXjc3iT5V2L2/iNUH8+4fc2dy3yofasKi1P8w5SWfj4DO oYf/dC6auiIKogFgbMXIH74v6xmxuqH0oTQC4UDTiEiPMgbVVo9xrQz4v+I1GJy0Xcyh fAZD/HnD3fQU6vDyPK3+URf+rgEoI7SXcV1hcECTBxwV46d/haiY1KXg7JzNJIAg0cZp PBJcuE4AyyYpHjCrDhNUyu+l9/WNGGasaU0VBAL0uDQPKu+ErXDSgF6yJBK8iV1iYTUi Ishl7HEjKBiiEVeY7mZOX5CwzNR9Klz60Cnfun+SA3GAaG/vLFnKlqQzhAAlLz+Cct6D sA4Q== X-Gm-Message-State: ACrzQf1GWkLMFtiwWIXqs0tna+xpkEjpQqj/Hc3DeLknohagORw15q1C 4GSjUrmDy4BKccELd6uTFrnlM5UK9gCz29WBkS537W0RtWE8AjB/Oh5efwQjb8yamc7pvVZ9bLm uKWSH7LJsQQhERxpP/J2rxQ9Vw3qhYco= X-Received: by 2002:a05:622a:408a:b0:35b:b5fa:5e32 with SMTP id cg10-20020a05622a408a00b0035bb5fa5e32mr19398090qtb.122.1664894298629; 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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP 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, 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!