From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 5F8B039730E9 for ; Fri, 13 May 2022 18:24:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F8B039730E9 Received: by mail-wr1-x431.google.com with SMTP id m1so12461782wrb.8 for ; Fri, 13 May 2022 11:24:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fgdNMRO7OO578g1WEN19DYswbme8cudwaMIhu31CIxA=; b=Ie3iF8uaMT+gIHlLW68CPfQPCx8usV9x0Kop3SYaoHeuyqTIjV61yEJyTNiW37rgOf ooUMobcRN6dilH7kDPXpeWGuNOliPbawQfk4ATclRBxd2HfTG3qFPlAIiTVD7qZFFb7j 56AirxlcM3rrpzKAihva6767SAigTvnTSfdgJSALT8DhGD5anvgSQwgZFQqyKbELcYF6 ho5/3wAqUBfDqyzXQDcl7hIVezr1vru/NxCBPIu6srFz232B1Cfx2hdzr6rg4WXo/JLX Zj/xblAQZ/EM7f38YmNDCMni54dzqDCBKr2RcFlCFZhFKxAbo7uqqu19DDTOxOpy19qW D9RQ== X-Gm-Message-State: AOAM533ve4trm/UahW7zSWkvgn7zsOTx52CsWZ+tLfQlazZYZQVCMn3s OuRYAMRHjZxg2v9Ft2CpJzEbZ43Q+ClTpttMHfk= X-Google-Smtp-Source: ABdhPJyrvWyqgJ5624xsMJIelHXFGKYcXqrVvuQ+QEHiT/0c7u1b7ih9CInfjNjIS2zzw6Ri9Xw6IIJLixCQjsihbGA= X-Received: by 2002:adf:dc91:0:b0:20c:cb51:4160 with SMTP id r17-20020adfdc91000000b0020ccb514160mr5025922wrj.568.1652466252782; Fri, 13 May 2022 11:24:12 -0700 (PDT) MIME-Version: 1.0 References: <7c754a932bd94cbf86fa20df7b611d2c@mentor.com> In-Reply-To: From: Jonathan Wakely Date: Fri, 13 May 2022 19:24:01 +0100 Message-ID: Subject: Re: compile time of code using long tuples To: "Foelsche, Peter" Cc: gcc-help X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 18:24:16 -0000 On Fri, 13 May 2022, 19:16 Jonathan Wakely, wrote: > > > On Fri, 13 May 2022, 19:13 Foelsche, Peter, > wrote: > >> I'm the author of some software which dumps out C++ code to be compiled >> with g++. >> This code sometimes contains many different and many long tuples. I >> deduced that long tuples cause rather long compile times. >> I already wrote some compression, which collects identical entries in >> such a tuple and moves them into an array. >> But this compression reduces (run-time) performance. >> I already wrote different tuple implementations, and one of the compiles >> much faster than the regular provided std::tuple. >> What could be the criterium for such a tuple implementation, which makes >> g++ take more or less compile time assuming the same code using this tuple? >> > > Identical object layout on all targets, meaning size, alignment, > base-class order, etc. It needs to be ABI-compatible. > I interpreted the question as asking what would be needed to replace the existing std::tuple. I guess you mean what aspects of the implementation affect compile time. The number of template instantiations, and the number of overload candidates for name lookup are probably important.