If the problem is in Code::Blocks, I would disable all CB plugins except for the Compiler.
Does it get faster, if yes, then enabled one plugin at a time to see which one is making it slow.
If it does not get faster, try compiling from the command line. Is it still slow?
Tim S.