Author Topic: Why do all my .cpp files take 5 seconds or longer to compile  (Read 76 times)

Offline speedreadersteve

  • Multiple posting newcomer
  • *
  • Posts: 11
They used to take only 1 second or shorter, but ever since I compiled a 500+ line file - mostly of comments and ~200 lines code, a lot of statements in main() - it's taken a consistent 6 seconds.  This adds up when I'm debugging with print tests.

I'm using v20.03
« Last Edit: Today at 06:00:38 am by speedreadersteve »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7338
    • My Best Post
They used to take only 1 second or shorter, but ever since I compiled a 500 long file - mostly of comments and ~200 lines code, a lot of statements in main() - it's taken a consistent 6 seconds.  This adds up when I'm debugging with print tests.

Single source file project or more than one "C" or "C++" file?
If more than one, using an pre-compilied header might help.

If only one file, I would look to anti-virus or try defragging the harddrive (Note, that is if you are still using an normal hardrive; I am not sure if Solid State Harddrive is a good idea to defrag)

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 speedreadersteve

  • Multiple posting newcomer
  • *
  • Posts: 11
I look at workspace and it contains nothing.  Every file is by itself. 

I'm new to programming, so I'm not too familiar with setting up projects or what they look like.  I always just start a new file rather than a new project, since I was more interested in learning the language than the platform.  The platform of codeblocks just looked simple enough for my needs.