User forums > Help

GNU GCC Compiler is compiling REALLY slow.

(1/8) > >>

Alos:
I dont know why but the compiler im using is compiling really really slow, I had 4 lines of code and it took about 12 minutes and then starting making error reports about lines 100-2000. Is there somthing im doing wrong? The code i wrote was

#include "SDL.h"
int main ( int argc , char* argv [] )
{
  return ( 0 ) ;
}

And I'm pretty sure I have SDL set up correctly, but im not so sure about the compiler, is there some option I should check/uncheck?

thomas:
12 minutes is quite a mouthful... gcc is known to be somewhat slow, but this example should pretty much compile in 2-3 seconds normally, anyway. It does for me, anyway.

This gross timing looks like you are running out of physical memory (running Windows XP on a 128 MB machine or something?).
On my machine, gcc uses between 60 and 230 MB of physical memory, depending on the complexity of the input files (number of includes, etc).

Have a look at task manager while you compile, specifically enable the display of page faults. If page faults go up like crazy while compiling (and your hard disk light goes frenzy) then you know what is wrong.

Alos:
When I do it with task manager up it makes CPU usage jump to 100%, but physical memory doesnt even flinch, I have over 750K of available physical mem, and when i go to the app's tab it says blocks is not responding.

thomas:

--- Quote from: Alos on October 02, 2005, 09:17:36 pm ---when i go to the app's tab it says blocks is not responding
--- End quote ---
Code::Blocks should be responding while compiling, as compiles run in a separate process and execution is non-blocking. The CPU time necessary to respond to a WM_ENABLE is not really a lot, so if Code::Blocks does not respond, something must prevent it from doing so.
One possibility would be a process with realtime priority which uses up all CPU cycles (it is rather safe to discard this hypothesis -- the compiler runs at "normal" priority, so the application would still process messages, even if 100% CPU is used, and what other processes would run only while compiling?).
The other possibility (the likely reason) is massive swapping.


--- Quote from: Alos on October 02, 2005, 09:17:36 pm ---I have over 750K of available physical mem
--- End quote ---
Did you really mean to say 750K? That would indeed mean that you have exceeded your RAM. 750k is practically zero.

Look at the number of page faults (enable the page faults column) to be sure.
cc1.exe has around 10.000-20.000 page faults on my system (depending on input file complexity) per run. Let's say that 20.000 is a "normal" number. If you run out of physical memory, you should see a lot more page faults (millions) in every process that takes up CPU, as it has to be swapped in each time its time slice is scheduled.

Alos:
750k as in 750,000. I have 1 gig of ram in my computer.

Navigation

[0] Message Index

[#] Next page

Go to full version