Liste des Groupes | Revenir à cl c |
On 21/06/2024 10:46, David Brown wrote:Both.On 20/06/2024 22:21, Vir Campestris wrote:Absolute time or relative?On 17/06/2024 20:29, David Brown wrote:>I do my C development with optimisations enabled, which means that the C compiler will obey all the rules and requirements of C. Optimisations don't change the meaning of correct code - they only have an effect on the results of your code if you have written incorrect code. I don't know about you, but my aim in development is to write /correct/ code. If disabling optimisations helped in some way, it would be due to bugs and luck.>
To me disabling optimisations does one slightly useful thing (compiles a little quicker) and one really useful one. It makes the interactive debugger work. Optimised code confuses the debugger, especially when it does things like reorder code, unroll loops, or merge equivalent functions.
>
Of course I then test with the optimised version.
>
Andy
>
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.
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 coldCold 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.
TM: 3.85
C:\c>tm gcc bignum.c -shared -s -obignum.dllAny build time under a second is as good as instant.
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
Les messages affichés proviennent d'usenet.