Re: Baby X is bor nagain

Liste des GroupesRevenir à cl c  
Sujet : Re: Baby X is bor nagain
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c
Date : 24. Jun 2024, 23:15:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5cnm9$14dri$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
User-Agent : Mozilla Thunderbird
On 24/06/2024 18:15, David Brown wrote:
On 24/06/2024 18:19, bart wrote:
On 24/06/2024 16:09, David Brown wrote:
On 24/06/2024 16:00, bart wrote:
>
However, is there any way of isolating the compilation time (turning .c files into either or .o files) from 'make' the linker?
>
Why would anyone want to do that?  At times, it can be useful to do partial builds, but compilation alone is not particularly useful.
>
It is useful when you are trying to establish the true cost of -O2 compared to -O0.
 And the relevance of that is... what?  Absolutely nothing.  We've already established that for some files, the difference is below the measurement threshold and for some (such as Scott's C++ example) it is massive.
 But just to please you, and not because it has any bearing on reality, I isolated a couple of C files from my code, removed the stuff that is specific to the target, and compiled with native gcc -O0 and -O2.
 For one file (the largest C file in the project), "gcc -O0" took 0.085 seconds.  "gcc -O2" took 0.134 seconds.  Yes, optimising was slow - but the time was negligible.  For the other file, both compiles were 0.025 seconds - too fast to be distinguishable from noise.
On my Windows machine, gcc -O0 took 0.20 seconds to build the 4-line hello.c. As measured with clock() when executing 'system("gcc hello.c")'.
On WSL using 'time', it took 0.146 seconds 'real' time, 0.007 seconds 'user' time, and 0.051 seconds 'sys' time.
I'm not sure what these mean, or which one, or which combination, you used to present your figures.
However, if someone is waiting for it to finish, it is the elapsed time that is relevant, since that is how long they have to wait!

Why do you think that is an appropriate way to guess the size of the project?  Michael does embedded development - that's likely to be a pretty big project with a lot of files.  This is not PC compilation where a "Hello, world" file can reach that size if statically linked.

No one cares about your figures.  No one, except you, cares about /my/ figures.  Sometimes people care about the build speed of /their/ code, using /their/ choice of compiler and /their/ choice of options on /their/ computers.  Do you /really/ not understand that the timings you get are utterly pointless to everyone else?
Obviously /you/ don't care about fast build systems. It's perfectly alright for 90% of the time to build a project to be spent executing auto-conf scripts.
Some people also cared enough about linkers to develop a new generation of linker (maybe 'gold', maybe something even newer) that is supposed to be 5 times the speed of 'ld'.
Who told them that linking was a bottleneck? Obviously not you! (And not me either; linking is just a nuisance, but I hadn't noticed it being a drag on the stuff I did.)

>
No one denies that "gcc -O0" is faster than "gcc -O3" for individual compiles, and that the percentage difference will vary and sometimes be large.

Yes, gcc ticks all the boxes. Except the last.
 No, it does not tick all the boxes.  The toolchains I use tick most of them (including all the ones that I see as hard requirements), and do better than any alternatives, but they are not perfect.  They do, however, happily pass the last one.  I have yet to find a C compiler that was not fast enough for my needs.
 
For me it would be like driving my car at walking pace all over town, even though most of my time would be spent at various stopping places.
 You still don't understand.  You are telling people how fantastically fast your car is, without realising it is just a remote-controlled toy car.  Nobody cars if your toy runs faster than a real tool - people will still choose the real tool.  And the real tools run fast enough for real developers doing real work.
You're wrong. My 'car' would do the equivalent job of driving around town. Unless someone /wanted/ a vehicle that was more like a 40-tonne truck.
Let's go back a few weeks to when the topic was translating millions of lines like this:
   unsigned char data[N] = {
          1,
          2,
          ....
   };
This is not very demanding of a compiler; there is little static analysis to do, no advanced code generation, not even a way of minimising size: it has to occupy at least N bytes in the output.
So would you really demand gcc be used here, because an object file produced by any lesser compiler woudldn't be up to scratch? gcc will of course take 20 times longer to do the job. (And 200 times longer than my language takes to directly embed the original binary.)
Would you allow the use of a dedicated utility program which turns such text into a binary file? It would rather churlish to say yes to this, and no to the use of Tiny C which could probably do the job too.
How about assemblers, which aren't too challenging either; would you be snobbish and patronising about those too?
I see basic compilation, naively translating source code to native code, as an equally low level, mechanical task. It should always be available as something to fall back on.

I use gcc - specifically toolchains built and released by ARM - because that is the tool that I rate highest on these factors.  If there were a similar featured clang toolchain I'd look closely at that too.  And over the years I have used many toolchains for many targets, some costing multiple $K for the license.
>
Of course everyone likes faster compiles, all other things being equal. But the other things are /not/ equal when comparing real-world development tools with the likes of tcc or your little compiler.  The idea that anyone should reasonably expect to get paid for wasting customer time and money with those is just laughable.
>
That's a good point. How much money has been wasted in paying programmers by the hour to twiddle their thumbs while waiting for a rebuild?
 None that I know of.  Your worries about compiler speed are imaginary or self-imposed.
So cartoons like https://xkcd.com/303/ have no basis in fact? It's just made up?
 > You /do/ realise that the only person that "suffers" from slow gcc times
 > is /you/ ?
Forums abound with horror stories. Here are quotes from just one thread:
------------------
Well a build used to take 6 or 7 minutes, and that's a long time for my little attention span. I'd always get distracted waiting for builds and waste even more time.
In short, if a developer is waiting on a build to run for one hour and doing nothing in that timeframe, the business is still spending $75 on average for that developer’s time—and potentially losing out on time that developer could be focusing on building more code.
I worked on a system where only linking the binary took 40-50 minutes. For some technical reasons there was no dynamic linking - only static - so you had to go through that delay for the slightest change.
This is why my computer and build server have an 11900k. Builds went from 45 minutes to 15.
This is the reason I stopped being a Java developer and embraced JS. Even the 1-3 minutes of build time was a big hit for me because it was just enough time for me to get distracted by something else and then the next thing you know, you have wasted 30 mins.
------------------
Maybe you should tell these guys how it's done!
That 1-3 minutes was the fastest build mentioned in these quotes, and that would absolutely kill me. Just 1-3 seconds feels like forever.
So what is taking the time? Is it very large programs? This is where I'd be interested in figures like MB of output per second.
If they're already doing 1-10MB/sec and it takes even one minute (so 60-600MB of output) then that's reasonable. The task is just huge, and they need to look at other approaches. But if they're only managing 10-100KB/sec, then those tools need attention.
The problem I have is that I've always worked in isolation and with my own tools. I never discovered fast or slow build processes were for anyone else. I just kept my own tools fast enough to suit me, even on 1980s hardware.
It turned out not only that they were very fast, but also toys!

Yes.  There are two issues with that.  First, a compiler as fast as tcc would make no practical difference at all to my development process. gcc is more than fast enough for my needs.  Secondly, there is no such tool, never has been, and I can confidently say, never will be.  I want far more from my tools than tcc can offer, and that takes more time.
 If gcc was ten times slower than it is, it might get annoying sometimes, and I'd then get a faster computer.
The wrong approach.

Date Sujet#  Auteur
11 Jun 24 * Baby X is bor nagain322Malcolm McLean
11 Jun 24 +* Re: Baby X is bor nagain3bart
11 Jun 24 i`* Re: Baby X is bor nagain2Malcolm McLean
12 Jun 24 i `- Mac users (Was: Baby X is bor nagain)1Kenny McCormack
11 Jun 24 +* Re: Baby X is bor nagain4Ben Bacarisse
11 Jun 24 i`* Re: Baby X is bor nagain3Malcolm McLean
12 Jun 24 i `* Re: Baby X is bor nagain2Ben Bacarisse
12 Jun 24 i  `- Re: Baby X is bor nagain1Malcolm McLean
11 Jun 24 +* Re: Baby X is bor nagain313Bonita Montero
11 Jun 24 i+* Re: Baby X is bor nagain309Malcolm McLean
12 Jun 24 ii`* Re: Baby X is bor nagain308Bonita Montero
12 Jun 24 ii +* Re: Baby X is bor nagain305David Brown
12 Jun 24 ii i+* Re: Baby X is bor nagain2Malcolm McLean
12 Jun 24 ii ii`- Re: Baby X is bor nagain1David Brown
12 Jun 24 ii i+- Re: Baby X is bor nagain1Bonita Montero
12 Jun 24 ii i`* Re: Baby X is bor nagain301bart
12 Jun 24 ii i +* Re: Baby X is bor nagain4Bonita Montero
12 Jun 24 ii i i`* Re: Baby X is bor nagain3bart
12 Jun 24 ii i i `* Re: Baby X is bor nagain2Bonita Montero
12 Jun 24 ii i i  `- Re: Baby X is bor nagain1bart
12 Jun 24 ii i `* Re: Baby X is bor nagain296David Brown
12 Jun 24 ii i  `* Re: Baby X is bor nagain295Michael S
13 Jun 24 ii i   +- Re: Baby X is bor nagain1Malcolm McLean
13 Jun 24 ii i   `* Re: Baby X is bor nagain293David Brown
13 Jun 24 ii i    +* Re: Baby X is bor nagain5bart
13 Jun 24 ii i    i+* Re: Baby X is bor nagain3tTh
13 Jun 24 ii i    ii`* Re: Baby X is bor nagain2bart
14 Jun 24 ii i    ii `- Re: Baby X is bor nagain1Bonita Montero
13 Jun 24 ii i    i`- Re: Baby X is bor nagain1Michael S
13 Jun 24 ii i    `* Re: Baby X is bor nagain287Michael S
14 Jun 24 ii i     +* Re: Baby X is bor nagain3David Brown
14 Jun 24 ii i     i`* Re: Baby X is bor nagain2bart
15 Jun 24 ii i     i `- Re: Baby X is bor nagain1David Brown
17 Jun 24 ii i     `* Re: Baby X is bor nagain283James Kuyper
17 Jun 24 ii i      +* Re: Baby X is bor nagain86Kaz Kylheku
17 Jun 24 ii i      i+- Are Javascript and Python similarly slow ? (Was: Baby X is bor nagain)1Michael S
17 Jun 24 ii i      i+* Re: Baby X is bor nagain2Michael S
18 Jun 24 ii i      ii`- Re: Baby X is bor nagain1Tim Rentsch
17 Jun 24 ii i      i+* Re: Baby X is bor nagain80David Brown
18 Jun 24 ii i      ii`* Re: Baby X is bor nagain79Michael S
18 Jun 24 ii i      ii `* Re: Baby X is bor nagain78David Brown
18 Jun 24 ii i      ii  +* Re: Baby X is bor nagain7bart
18 Jun 24 ii i      ii  i`* Re: Baby X is bor nagain6David Brown
18 Jun 24 ii i      ii  i +* Re: Baby X is bor nagain2bart
18 Jun 24 ii i      ii  i i`- Re: Baby X is bor nagain1David Brown
18 Jun 24 ii i      ii  i `* Re: Baby X is bor nagain3DFS
18 Jun 24 ii i      ii  i  `* Re: Baby X is bor nagain2Mark Bourne
18 Jun 24 ii i      ii  i   `- Re: Baby X is bor nagain1DFS
18 Jun 24 ii i      ii  +* Re: Baby X is bor nagain3Malcolm McLean
18 Jun 24 ii i      ii  i+- Re: Baby X is bor nagain1David Brown
18 Jun 24 ii i      ii  i`- Re: Baby X is bor nagain1Mark Bourne
18 Jun 24 ii i      ii  `* Re: Baby X is bor nagain67Michael S
18 Jun 24 ii i      ii   +* Re: Baby X is bor nagain65Malcolm McLean
19 Jun 24 ii i      ii   i+* Re: Baby X is bor nagain59Keith Thompson
19 Jun 24 ii i      ii   ii`* Re: Baby X is bor nagain58Malcolm McLean
19 Jun 24 ii i      ii   ii +* Re: Baby X is bor nagain56David Brown
19 Jun 24 ii i      ii   ii i`* Re: Baby X is bor nagain55Malcolm McLean
19 Jun 24 ii i      ii   ii i `* Re: Baby X is bor nagain54David Brown
19 Jun 24 ii i      ii   ii i  `* Re: Baby X is bor nagain53Malcolm McLean
19 Jun 24 ii i      ii   ii i   +* Re: Baby X is bor nagain10bart
20 Jun 24 ii i      ii   ii i   i`* Re: Baby X is bor nagain9David Brown
20 Jun 24 ii i      ii   ii i   i `* Re: Baby X is bor nagain8bart
20 Jun 24 ii i      ii   ii i   i  `* Re: Baby X is bor nagain7David Brown
20 Jun 24 ii i      ii   ii i   i   `* Re: Baby X is bor nagain6bart
20 Jun 24 ii i      ii   ii i   i    +* Re: Baby X is bor nagain2Michael S
20 Jun 24 ii i      ii   ii i   i    i`- Re: Baby X is bor nagain1bart
20 Jun 24 ii i      ii   ii i   i    `* Re: Baby X is bor nagain3David Brown
21 Jun 24 ii i      ii   ii i   i     `* Re: Baby X is bor nagain2bart
21 Jun 24 ii i      ii   ii i   i      `- Re: Baby X is bor nagain1David Brown
20 Jun 24 ii i      ii   ii i   `* Re: Baby X is bor nagain42David Brown
20 Jun 24 ii i      ii   ii i    `* Re: Baby X is bor nagain41Malcolm McLean
20 Jun 24 ii i      ii   ii i     +- Re: Baby X is bor nagain1David Brown
20 Jun 24 ii i      ii   ii i     `* Re: Baby X is bor nagain39Ben Bacarisse
20 Jun 24 ii i      ii   ii i      +* Re: Baby X is bor nagain2Malcolm McLean
20 Jun 24 ii i      ii   ii i      i`- Re: Baby X is bor nagain1Ben Bacarisse
20 Jun 24 ii i      ii   ii i      +* Re: Baby X is bor nagain9Tim Rentsch
20 Jun 24 ii i      ii   ii i      i`* Re: Baby X is bor nagain8Malcolm McLean
20 Jun 24 ii i      ii   ii i      i +* Re: Baby X is bor nagain2James Kuyper
20 Jun 24 ii i      ii   ii i      i i`- Re: Baby X is bor nagain1Keith Thompson
20 Jun 24 ii i      ii   ii i      i +- Re: Baby X is bor nagain1Vir Campestris
20 Jun 24 ii i      ii   ii i      i +* Re: Baby X is bor nagain2Keith Thompson
21 Jun 24 ii i      ii   ii i      i i`- Re: Baby X is bor nagain1vallor
21 Jun 24 ii i      ii   ii i      i +- Re: Baby X is bor nagain1Tim Rentsch
21 Jun 24 ii i      ii   ii i      i `- Re: Baby X is bor nagain1David Brown
20 Jun 24 ii i      ii   ii i      `* Re: Baby X is bor nagain27Keith Thompson
20 Jun 24 ii i      ii   ii i       `* Re: Baby X is bor nagain26Ben Bacarisse
20 Jun 24 ii i      ii   ii i        +* Re: Baby X is bor nagain2Michael S
21 Jun 24 ii i      ii   ii i        i`- Re: Baby X is bor nagain1Ben Bacarisse
20 Jun 24 ii i      ii   ii i        +- Re: Baby X is bor nagain1Keith Thompson
21 Jun 24 ii i      ii   ii i        +* Re: Baby X is bor nagain2James Kuyper
21 Jun 24 ii i      ii   ii i        i`- Re: Baby X is bor nagain1Keith Thompson
22 Jun 24 ii i      ii   ii i        `* Re: Baby X is bor nagain20Tim Rentsch
23 Jun 24 ii i      ii   ii i         `* Re: Baby X is bor nagain19Ben Bacarisse
23 Jun 24 ii i      ii   ii i          +* Re: Baby X is bor nagain9James Kuyper
23 Jun 24 ii i      ii   ii i          i`* Re: Baby X is bor nagain8Tim Rentsch
24 Jun 24 ii i      ii   ii i          i +* Re: Baby X is bor nagain4Ben Bacarisse
24 Jun 24 ii i      ii   ii i          i i`* Re: Baby X is bor nagain3Tim Rentsch
25 Jun 24 ii i      ii   ii i          i i `* Re: Baby X is bor nagain2Ben Bacarisse
25 Jun 24 ii i      ii   ii i          i i  `- Re: Baby X is bor nagain1Tim Rentsch
24 Jun 24 ii i      ii   ii i          i `* Re: Baby X is bor nagain3Keith Thompson
24 Jun 24 ii i      ii   ii i          i  `* Re: Baby X is bor nagain2Tim Rentsch
23 Jun 24 ii i      ii   ii i          `* Re: Baby X is bor nagain9Tim Rentsch
19 Jun 24 ii i      ii   ii `- Re: Baby X is bor nagain1Keith Thompson
19 Jun 24 ii i      ii   i`* Re: Baby X is bor nagain5David Brown
19 Jun 24 ii i      ii   `- Re: Baby X is bor nagain1David Brown
18 Jun 24 ii i      i+- Re: Baby X is bor nagain1James Kuyper
20 Jun 24 ii i      i`- Re: Baby X is bor nagain1Vir Campestris
17 Jun 24 ii i      +* Re: Baby X is bor nagain193bart
17 Jun 24 ii i      `* Re: Baby X is bor nagain3Malcolm McLean
12 Jun 24 ii `* Topicality is not your strong suit (Was: Baby X is bor nagain)2Kenny McCormack
11 Jun 24 i`* Re: Baby X is bor nagain3bart
11 Jun 24 `- Re: Baby X is bor nagain1Kalevi Kolttonen

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal