compiler is very slow

From some reason my gcc compiler is taking 2 minutes to compile, as if it waits 2 minutes then compiles.

I'm testing it with the basic hello world program so it is not the code. I tried code blocks and wxdev(tried reinstalling too), both work fine but compiling takes so long and I can't wait 2 minutes every time I want to test my code. And when I look at CPU usage it is almost as nothing is going on.
I tried compiler Visual C++ 2010, but that gives me error and warning, but it is not slow though.

Hope someone knows what might be happening?

EDIT: From some reason I got a lot of replies that have nothing to do with the problem. I mean seriously I said I'm testing the hello world program and the CPU is used as if nothing is going on, it is about the compiler not the computer.

But nwm it suddenly started working normally.
Last edited on
Do you have your projects on a USB harddrive?
Seems like you need to invest in a new hard drive.
It is not on USB and if hard drive was the problem it wouldn't have worked yesterday and other compilers and programs would also load slowly.

Yesterday I changed the compiler in wxdev and it wouldn't compiled when I changed it back to gcc, so today I tried code blocks and it compiled slowly, so I reinstalled wxdev and it compiled slowly too, tried to reinstall it few more time to change settings to default but nothing changed.

It is only slow when compiling, when I finish compiling and press compile again without editing it just runs the program instantly (as usual), it runs normally when I edit code and do stuff.
Look for the harddrive settings. I think it goes off after let's say 15 min and when you try to compile it takes time before the harddrive initialises. If you compile and then you compile again and it works it is the harddrive settings.
Last edited on
You didn't understanded. When you compile the IDE will not run the compiler again unless you change the code.
That's a good thing...
That is not the point, that is normal.
The thing is that the compiler is slow!

Maybe I should reinstall just the compiler? Does anyone know how?

I encountered this exact problem as well, with Visual Studio 2012 Ultimate.

I expect to see no difference in solution either.

Is your project very big in terms of size of Code? If Yes, I suggest either extracting the code into multiple DLL files in order to speed up the process if no, I would advice you to re-install the compiler.

I also found out that if you have more than 4+ instances of a IDE open it can cause significant compiler slow down. Next if the IDE you are using x86 bit then the slow down is due to more instances open.

I am not jumping any conclusions because this is a generic guess because I lack the information needed for me to properly asses your situation.

closed account (Dy7SLyTq)
what processor and how much ram do you have?
$ time g++ hello_world.cpp
@SpaceWorm and @DTSCode you apparently didn't read my question right.
I am testing it on the default hello world program and the CPU is used as if nothing is running and VC 2010 compiler works with normal speed (but gives an error when compiling like it normally does).

@ne555 what do you expect me to do with that?

And no one answered yet, can I reinstall just the gcc compiler and how?
It suddenly started working normally. Compiled hello world in 2sec.

But still, is there a way to reinstall the compiler?
Last edited on
These might help:

1. If the amount of free space on your logical volume is low, free some space (compress, backup and delete etc),

2. If the logical volume is heavily fragmented, defragment it.

3. Exclude the directory containing the GNU toolchain from realtime virus/spyware monitoring.
Why is everyone reading what I wrote wrong???
closed account (Dy7SLyTq)
no i didnt read it wrong. it doesnt matter if you have nothing on your cpu... if its an old amd with 200 mb of ram (this is just an example guys i cant remember min for os's to run plz dont fight me on this) its going to go slow
I had plenty of free ram and yes, it is about 250mb.
closed account (Dy7SLyTq)
250 mb is not plenty of ram. 4 gigs is plenty of ram.
250 mb of ram requires an upgrade. That's the reason your compiler is slow.
I was referring to what DTSCode said, 250MB is the minimum for the operating system to work.
Topic archived. No new replies allowed.