Liste des Groupes | Revenir à cl c |
On 23/06/2024 19:21, bart wrote:43 seconds compile time is getting to be a bit of a problem. But not for the final build. Only for intermediate builds.On 23/06/2024 13:25, David Brown wrote: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.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!
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.
Les messages affichés proviennent d'usenet.