Liste des Groupes | Revenir à cl c |
On 21/06/2024 11:46, David Brown wrote:C headers for most other libraries are usually also short, at least compared to C++ headers.On 20/06/2024 22:31, Vir Campestris wrote:C standard headers are nothing. From 3K to 5K lines between Windows and Linux, last time I looked. That's for all 30 headers.On 17/06/2024 14:43, David Brown wrote:>>>>
Compilation speed is important to everyone. That's why so many tricks are used to get around the lack of speed in a big compiler, or so many extra resources are thrown at the problem.
What "tricks" ?
Precompiled headers sprang to mind in about half a second.
>
<https://en.wikipedia.org/wiki/Precompiled_header>
>
Andy
These are used primarily in C++, where you often have /very/ large headers that require a significant amount of analysis. In C, this is not remotely the same scale of problem. C headers are usually far shorter - and far simpler to process. (In a quick test on my system, #include <stdio.h> pulled in 792 lines, while #include <iostream> took 28152 lines.)
(Which is why I think they should just be included anyway.)That would be a terrible idea for many reasons.
But library headers can be much bigger. I already gave a timing for windows.h, of 1.4 seconds. SDL2, quite a small library compared with some, is still 50K lines, and adds 0.75 seconds compilation per module.I don't know what version of SDL headers I have (it's not a library I have used myself), but there are about 30 headers in the /usr/include/SDL/ folder, totalling some 12K lines (after preprocessing). Including them all in an otherwise blank C file takes about 40-50 ms to compile - basically, noise.
Les messages affichés proviennent d'usenet.