Deutsch   English   Français   Italiano  
<v5a2tk$gouo$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feeds.phibee-telecom.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Baby X is bor nagain
Date: Sun, 23 Jun 2024 22:09:09 +0100
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <v5a2tk$gouo$1@dont-email.me>
References: <v494f9$von8$1@dont-email.me>
 <v49seg$14cva$1@raubtier-asyl.eternal-september.org>
 <v49t6f$14i1o$1@dont-email.me>
 <v4bcbj$1gqlo$1@raubtier-asyl.eternal-september.org>
 <v4bh56$1hibd$1@dont-email.me> <v4c0mg$1kjmk$1@dont-email.me>
 <v4c8s4$1lki1$4@dont-email.me> <20240613002933.000075c5@yahoo.com>
 <v4emki$28d1b$1@dont-email.me> <20240613174354.00005498@yahoo.com>
 <v4okn9$flpo$2@dont-email.me> <v4p37r$k32n$1@dont-email.me>
 <v4pei3$m5th$2@dont-email.me> <v4plsk$nn9o$2@dont-email.me>
 <v4pnq6$o4fs$1@dont-email.me> <v4q245$si2n$1@dont-email.me>
 <v4q2rl$sqk3$1@dont-email.me> <v52308$2nli8$3@dont-email.me>
 <v53i4s$33k73$2@dont-email.me> <v53lf7$34huc$1@dont-email.me>
 <v53vh6$368vf$1@dont-email.me> <v54se1$3bqsk$1@dont-email.me>
 <v5948h$bale$1@dont-email.me> <v59p2j$eodu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 23 Jun 2024 23:09:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0266ed5046595e5c7aa872240b0c2e48";
	logging-data="549848"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18i5YmbOrq3mxHGyvPcaGfT"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mTa4bwG+SyVqiQQvSOsWCO5g1yE=
Content-Language: en-GB
In-Reply-To: <v59p2j$eodu$1@dont-email.me>
Bytes: 3812

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.