Liste des Groupes | Revenir à cl c |
On 24/06/2024 18:19, bart wrote: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 24/06/2024 16:09, David Brown wrote: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.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.
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.
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.
>
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.
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.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.
So cartoons like https://xkcd.com/303/ have no basis in fact? It's just made up?None that I know of. Your worries about compiler speed are imaginary or self-imposed.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?
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.The wrong approach.
If gcc was ten times slower than it is, it might get annoying sometimes, and I'd then get a faster computer.
Les messages affichés proviennent d'usenet.