Liste des Groupes | Revenir à cl c |
On 21/06/2024 14:34, David Brown wrote:On 21/06/2024 12:42, bart wrote:On 21/06/2024 10:46, David Brown wrote:>>
>
I understand your viewpoint and motivation. But my own
experience is mostly different.
>
First, to get it out of the way, there's the speed of
compilation. While heavy optimisation (-O3) can take noticeably
longer, I never see -O0 as being in any noticeable way faster for
compilation than -O1 or even -O2.
Absolute time or relative?
Both.
For me, optimised options with gcc always take longer:
Of course. But I said it was not noticeable - it does not make
enough difference in speed for it to be worth choosing.
C:\c>tm gcc bignum.c -shared -s -obignum.dll # from cold
TM: 3.85
Cold build times are irrelevant to development - when you are
working on a project, all the source files and all your compiler
files are in the PC's cache.
C:\c>tm gcc bignum.c -shared -s -obignum.dll
TM: 0.31
C:\c>tm gcc bignum.c -shared -s -obignum.dll -O2
TM: 0.83
C:\c>tm gcc bignum.c -shared -s -obignum.dll -O3
TM: 0.93
C:\c>dir bignum.dll
21/06/2024 11:14 35,840 bignum.dll
Any build time under a second is as good as instant.
I tested on a real project, not a single file. It has 158 C files
and about 220 header files. And I ran it on my old PC, without any
"tricks" that you dislike so much, doing full clean re-builds. The
files are actually all compiled twice, building two variants of the
binary.
With -O2, it took 34.3 seconds to build. With -O1, it took 33.4
seconds. With -O0, it took 30.8 seconds.
So that is a 15% difference for full builds. In practice, of
course, full rebuilds are rarely needed, and most builds after
changes to the source are within a second or so.
Then there's something very peculiar about your codebase.
Les messages affichés proviennent d'usenet.