Deutsch   English   Français   Italiano  
<vip97i$po6v$2@dont-email.me>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Wed, 4 Dec 2024 11:00:18 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <vip97i$po6v$2@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <viaqh0$nm7q$1@dont-email.me>
 <877c8nt255.fsf@nosuchdomain.example.com> <viasv4$nm7q$2@dont-email.me>
 <vibr1l$vvjf$1@dont-email.me> <vic73f$1205f$1@dont-email.me>
 <20241129142810.00007920@yahoo.com> <vicfra$13nl4$1@dont-email.me>
 <20241129161517.000010b8@yahoo.com> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <87mshhsrr0.fsf@nosuchdomain.example.com>
 <vidd2a$18k9j$1@dont-email.me> <8734j9sj0f.fsf@nosuchdomain.example.com>
 <vidnp3$1ovvm$2@paganini.bofh.team> <vihpjh$2hgg1$1@dont-email.me>
 <vihrh1$2hk5l$1@dont-email.me> <vii0jp$2jkd9$1@dont-email.me>
 <viifv8$2opi7$1@dont-email.me> <vik28b$390eg$1@dont-email.me>
 <vik8tc$3ang9$1@dont-email.me> <vikjff$3dgvc$1@dont-email.me>
 <viku00$3gamg$1@dont-email.me> <vil0qc$3fqqa$3@dont-email.me>
 <vil82t$3ie9o$2@dont-email.me> <vila9j$3j4dg$1@dont-email.me>
 <vin4su$49a6$1@dont-email.me> <vinuhv$cc1d$1@dont-email.me>
 <vio6u7$dtmc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 04 Dec 2024 11:00:18 +0100 (CET)
Injection-Info: dont-email.me; posting-host="3d4736a0b9182c19006430c54e7a5ec1";
	logging-data="843999"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+jgsmHISWY0PdhohOXLGwPGQ/EA6u1YyQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:rhndqCeSCPJqTSaro09aEISVwck=
In-Reply-To: <vio6u7$dtmc$1@dont-email.me>
Content-Language: en-GB
Bytes: 5282

On 04/12/2024 01:15, Bart wrote:
> On 03/12/2024 21:51, Bart wrote:
>> On 03/12/2024 14:34, David Brown wrote:
>>> On 02/12/2024 22:53, Bart wrote:
>>
>>> For the project-specific code, rather than libraries, SDK, etc.:
>>>
>>> -----------------------------------------------------------------------
>>> Language             files          blank        comment           code
>>> -----------------------------------------------------------------------
>>> C++                     39           2217           1020          11820
>>> C/C++ Header            44           1078            798           2696
>>> C                        3            259            237           1152
>>> -----------------------------------------------------------------------
>>> SUM:                    86           3554           2055          15668
>>> ------------------------------------------------------------------------
>>>
>>
>>> Not that it really matters, but a typical build for my project takes 
>>> about 1 to 3 seconds.
>>
>> I don't really know what they means, because I don't know is involved, 
>> and what is being missed out.
>>
>> So, to get an idea of how long gcc really takes (or would take on my 
>> machine), I set up a comparable test. I took an 800-line C program, 
>> and duplicated it in 200 separate files f1.c to f200.c, for a total 
>> line count of 167Kloc.
>>
>> gcc took 30 to 90 seconds to create an EXE using -O0 and -O2.
>>
>> Under WSL, it took 18 to 54 seconds 'real time' (to .o files; it can't 
>> link due to Win32 imports).
>>
>> Tiny C took 0.64 seconds.
>>
>> My two C compilers were rubbish so I won't report those timings (the 
>> newer one only works a file at a time anyway so needs invoking 200 
>> times).
> 
> The timing from one was about 9 seconds when it was generating 200 .obj 
> files, before I tweaked things to allow an EXE to be created (by using 
> 'static' in each file to avoid clashes).
> 
> If I also include my original compiler when I strived to make multiple 
> files more efficient, then timings on Windows are:
> 
>    mm   0.53 seconds  (Non-C test inputs)
>    tcc  0.64 seconds
>    bcc  1    second
>    mcc  3    seconds
>    cc   5    seconds (to produce 200 .obj files)
>    gcc 32    seconds (-O0, v.14.1; the WSL timing was for 9.4)
> 
> The original 93 seconds for gcc-O2 was for a test using non-static 
> functions and generating 200 .o files. I reran it for EXE using -O0 but 
> not with -O2.
> 
> If I do so now, gcc-O2 takes 18 seconds, but it produces a too-small EXE 
> file. Presumably it is largely discarding the 199 modules that comprise 
> only static functions.
> 
> So that timing is erroneous.
> 

I don't know why you are bothering with this.  Most of the compilers you 
use here are useless for actual work, and the timings for them are 
therefore irrelevant.  Your nonsense collection of random files with 
meaningless choices of "static" or "non-static" is in no way 
representative of anything.