Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:I think the main problem is that Bart doesn't understand what "builds" are. And he doesn't understand the relevance - or irrelevance - of compile times while developing software, and how they relate to /build/ times or /development/ time. I don't care how long it takes to compile a file - I care how long the build takes.On 24/06/2024 00:52, Malcolm McLean wrote:43 seconds compile time is getting to be a bit of a problem. But not for>
the final build. Only for intermediate builds.
That isn't the issue here (it could have been 4.3 seconds vs 1.7 seconds).
>
David Brown was claiming there was little difference (15%, although on
the 34.3s and 30.8s timings, it is actually 11% not 15%) between
optimised and unoptimised builds, whereas I have always seen substantial
differences like 100% or more.
David is likely referring to the average.I think in this case it was just estimating percentages in my head, rounding up - it's all approximate.
You've obviously foundSome optimisations scale quadratically or worse, by code size and/or complexity. And using -O3 rather than -O2 will enable optimisation passes that can take a lot longer while usually only having minor benefits to the generated code, and indeed risking giving worse results. So some types of code can take an inordinate amount of time to compile with -O3. Typical cases are very large files or files with very large functions - C code generated by other tools (such as simulators generated from HDL languages) can often be problematic. If it matters, it's normally possible to do some fine-tuning with particular optimisation passes or fiddling optimiser parameters.
an outlier. I've one outlier that compiles with -O0 in about
15 seconds, and with -O3 it takes 8 minutes. However, the
code in that file is far from optimal. The rest of the source
files in that project (20+ million lines) are more in the 10-15%
range, if that high.
I took a look at the outlier, and got rid of some unnecessary
local block declarations in a large function, removed some unnecessary
#include's and cut the -O3 time in half, to just under 4
minutes. The variable tracking feature of the gnu compiler
collection seems to be the culprit here.
Les messages affichés proviennent d'usenet.