Jo Even Skarstein wrote:
I'm no gcc-expert, far from it. But I think that the major reason for the poor performance (in terms of resource usage) of gcc on our systems is the build system. make calling make, gcc being loaded for every single source file... It's not very efficient. I think it should be possible to gain a lot of speed by building more efficiently.
There are several reasons why the compilation with GCC is slow:1) As you underline for the compilation of a single file, there are a lot of process spawned: make, sh, gcc, cc1, as... They all use fork() to spawn the child process. It is extremely fast on UNIX-like kernels, thanks to a clever usage of virtual memory. But it is partially emulated on MiNT (and Cygwin, too), thus the spawning of a new process is very slow.
2) The gcc executables are huge. It takes some time to load them from disk into memory and relocated them.
3) Intermediate files are used, at lease for the generated assembler sources, maybe also for the preprocessed source.
4) When optimization is turned on, GCC really use a lot of CPU for the best result. Of course it takes more time on slow machines.
-- Vincent Rivière