Author Topic: "Slow" Build and Runs  (Read 22882 times)

Offline steptaker

  • Single posting newcomer
  • *
  • Posts: 2
"Slow" Build and Runs
« on: July 06, 2012, 08:04:23 pm »
Hey guys,
I recently installed CodeBlocks 10.05 and I've been following some tutorials and I've noticed that my build and run times are quite slow compared to theirs (around 7-8 seconds) and sometimes it goes to "Not responding" and will sometimes cause me to force quit. I've tried reinstalling it and what not, does anyone have a idea or fix how I can make them faster?

[OS] - Windows 7 Ultimate
[CPU] - i7-3770k at 3.6 ghz
[RAM] - 16gb DDR3 1866 mhz
[SSD] - OCZ Vertex 4 - Read 560 mb/s, Write 430/mbs

I'm using a fresh install of Windows 7, it's been up for the past 3 days. Considering the date of the videos and the build I'm using I'd assume that my compile times would be a bit faster. I run CodeBlocks with only my Anti-Virus present (I have tried disabling it and the build times are still slow).

Thanks in advance,
Step

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: "Slow" Build and Runs
« Reply #1 on: July 06, 2012, 08:09:42 pm »
What is the setting of  Settings -> Compiler -> your compiler -> Build options -> Number of processors?

For your CPU it should be 8-12. This option will help you if you have many files. If you have 1 file it doesn't matter.

p.s. you've not mentioned what compiler you're using, so this might be the cause.
p.p.s. gcc on windows is slower than the linux version, 2x and more times slower...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline steptaker

  • Single posting newcomer
  • *
  • Posts: 2
Re: "Slow" Build and Runs
« Reply #2 on: July 06, 2012, 08:40:09 pm »
I'm using GNU GCC Compiler and at the moment I only work on one file at a time (basic ones too, 2-3 variables and classes at a time). I turned up the number of processors and I get 4 second builds. Is that normal for using Windows?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: "Slow" Build and Runs
« Reply #3 on: July 06, 2012, 08:54:26 pm »
GCC version? I'm not a prophet...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7178
    • My Best Post
Re: "Slow" Build and Runs
« Reply #4 on: July 06, 2012, 09:55:09 pm »
I suggest turning on Full Compiler Logging and get the commands being passed to the Compiler.

Try the commands to see how long they take to build the file.

I also suggest just doing build; followed by run to see which is the worst problem.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline chinmish

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Slow" Build and Runs
« Reply #5 on: July 05, 2015, 03:48:14 pm »
Did you find the solution? I am using  a system with Core i5 4th gen 4200M @2.5GHz with 8GB ram and my codeblocks is 13.12 and compiler edition is TDM-GCC 4.9.2 64 bit release. I am new to coding and related stuff. I also tried other platforms like Dev-C++ and Eclipse CDT. I am having the same issue. Same compiler version.
« Last Edit: July 05, 2015, 04:03:56 pm by chinmish »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: "Slow" Build and Runs
« Reply #6 on: July 05, 2015, 05:32:58 pm »
Do you have antivirus software running?
Is it faster if you try to compile manually from a command line?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline chinmish

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Slow" Build and Runs
« Reply #7 on: July 05, 2015, 07:28:45 pm »
I tried Cygwin compiler and nano editor. It again took a long time. Yes, I have an antivirus software(Avast). I really want to solve this issue. Thanks for the help.

I used Turbo C++ and this problem was not observed in Turbo C++.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: "Slow" Build and Runs
« Reply #8 on: July 05, 2015, 08:02:00 pm »
Does build time change if you set an exception (or disable altogether) in your antivirus so it does not check the folder you installed your compiler to, and the folder you are programming/building in?

Offline chinmish

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Slow" Build and Runs
« Reply #9 on: July 05, 2015, 08:09:52 pm »
Adding exclusion didn't bring any significant change in compiling. However, execution of the same program was completed in 0.25 seconds.

I don't know if this is relevant but the same program, when executed on TurboC++, gives result in no time.

Thank you.
« Last Edit: July 05, 2015, 08:20:23 pm by chinmish »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: "Slow" Build and Runs
« Reply #10 on: July 05, 2015, 09:07:31 pm »
What about disabling AV software?
Have you tried to run the came command in a cmd.exe window outside of codeblocks?

And please don't use cygwin as far as I know it is expected to be slow.
Also mingw is known to be slow, but not that slow.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline chinmish

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Slow" Build and Runs
« Reply #11 on: July 05, 2015, 09:43:42 pm »
This did the trick. Thanks for your help. The program compiled within 1second.

Is this much time okay or should it further go down? And is there any way by which I can keep my antivirus on and keep using Codeblocks.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7178
    • My Best Post
Re: "Slow" Build and Runs
« Reply #12 on: July 06, 2015, 02:58:24 am »
This did the trick. Thanks for your help. The program compiled within 1second.

Is this much time okay or should it further go down? And is there any way by which I can keep my antivirus on and keep using Codeblocks.

I think 1 second is likely the best you will get; if your computer is a slow as mine is.
I considered 1 second per compiled file to be the fastest that my computer can normally do.
(But, my computer is very old 2.2 Ghz with 32 bit Windows 7 OS.)
But, CB does NOT show fractions of a second; so I am guess anything above 0.5 seconds (up to 1.5) shows as 1 second.

On the last topic, learn about your Anti-Virus; figure out how to white list both Code::Blocks and the Compiler you are using.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline chinmish

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Slow" Build and Runs
« Reply #13 on: July 06, 2015, 06:16:30 am »
For any Avast user reading this

1. Open the interface
2. Go to settings
3. Go to general
4. Scroll down and you will find 'exclusion'
5. Enter the directory in which your CodeBlocks is installed. Also enter the directory in which you have saved your project.

I think my system is not much old. Core i5 4th gen 4200M @2.5GHz with 8GB [email protected] and HDD 5400rpm and my codeblocks is 13.12 and compiler edition is TDM-GCC 4.9.2 64 bit release.
« Last Edit: July 06, 2015, 06:22:53 am by chinmish »