Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Malcolm McLean Newsgroups: comp.lang.c Subject: Re: Baby X is bor nagain Date: Mon, 24 Jun 2024 00:52:28 +0100 Organization: A noiseless patient Spider Lines: 65 Message-ID: References: <20240613002933.000075c5@yahoo.com> <20240613174354.00005498@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 24 Jun 2024 01:52:28 +0200 (CEST) Injection-Info: dont-email.me; posting-host="76235cb8c764da1de79af604a40e204d"; logging-data="613329"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Rax8nZapcJvZd8iyl+1lHL1FLbQLGrm0=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:VKMVtbup0jBngs+yQTj6H6VWvrc= Content-Language: en-GB In-Reply-To: Bytes: 4204 On 23/06/2024 22:09, bart wrote: > On 23/06/2024 19:21, bart wrote: >> On 23/06/2024 13:25, David Brown wrote: > >>> In my experience, programs don't usually consist of a single C file. >>> And if they do, build time is rarely long enough to worry anyone. >>> >>> I think, from the history of discussions in this group, that it is >>> more likely that your codebases are the peculiar ones. >> >> >> I specifically excluded any of my own. I tried a variety of distinct >> projects, all sharing the same characteristics: that -O3 generally >> doubled build time, sometimes a bit less, often a lot more. >> >> But you seem remarkably unbothered that in your code-base, the >> difference is only 15% [for -O2]. I'd be quite curious. >> >> If that really was typical, and I was in charge of gcc, I'd seriously >> consider whether to bother with the -O0 and -O1 levels. >> >> However the following timings to build TCC/lUA are typical of my >> experience of gcc over 10-20 years: >> >>     (tcc  0.10) >>     -O0   2.84 seconds to build tcc.exe >>     -O1   5.70 >>     -O2  10.78 >>     -O3  13.21 >> >>     (tcc  0.25) >>     -O0   7.74 seconds to build lua.exe >>     -O1  10.63 >>     -O2  14.95 >>     -O3  18.24 >> >> I've shown the timings from building with Tcc to give some >> perspective. The proportional difference between -O3 and -O0 is indeed >> small compared with that between -O0 and tcc! > > I've done one more test, which is compiling 140 .c files of Seed7 to > object files (not linking). This was done under WSL and outside of a > makefile where there were a million things going on that I had no idea > about. > > Results were: > >   -O0   17 seconds >   -O2   36 seconds >   -O3   43 seconds > > This was done with one invocation of gcc. Invoking gcc each time might > well make it slower, but a test I did along those lines was not conclusive. > > So, if the difference between O0 and O2 is so narrow for you, and it's > not the source code, nor how you invoke gcc, then there must be other > things going on. > > 43 seconds compile time is getting to be a bit of a problem. But not for the final build. Only for intermediate builds. -- Check out my hobby project. http://malcolmmclean.github.io/babyxrc