Liste des Groupes | Revenir à cl c |
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 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.
>
I think, from the history of discussions in this group, that it is more likely that your codebases are the peculiar ones.
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!
Les messages affichés proviennent d'usenet.