public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compile time of code using long tuples
@ 2022-05-13 18:13 Foelsche, Peter
  2022-05-13 18:16 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Foelsche, Peter @ 2022-05-13 18:13 UTC (permalink / raw)
  To: gcc-help

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?

Peter



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: compile time of code using long tuples
  2022-05-13 18:13 compile time of code using long tuples Foelsche, Peter
@ 2022-05-13 18:16 ` Jonathan Wakely
  2022-05-13 18:24   ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2022-05-13 18:16 UTC (permalink / raw)
  To: Foelsche, Peter; +Cc: gcc-help

On Fri, 13 May 2022, 19:13 Foelsche, Peter, <Peter_Foelsche@mentor.com>
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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: compile time of code using long tuples
  2022-05-13 18:16 ` Jonathan Wakely
@ 2022-05-13 18:24   ` Jonathan Wakely
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2022-05-13 18:24 UTC (permalink / raw)
  To: Foelsche, Peter; +Cc: gcc-help

On Fri, 13 May 2022, 19:16 Jonathan Wakely, <jwakely.gcc@gmail.com> wrote:

>
>
> On Fri, 13 May 2022, 19:13 Foelsche, Peter, <Peter_Foelsche@mentor.com>
> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-13 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 18:13 compile time of code using long tuples Foelsche, Peter
2022-05-13 18:16 ` Jonathan Wakely
2022-05-13 18:24   ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).