Author Topic: Compile & linking taking way too long.  (Read 7743 times)

kostaxtreme

  • Guest
Compile & linking taking way too long.
« on: November 26, 2008, 12:10:53 pm »
Hi guys,

I'm totally new to the forum and not the greatest of coders as I'm just working on it for uni and such. Anyways I've had a look around other sites for this issue but none seem to address the problem I've got atm. Ultimately I've come to the forums seeing that this would most probably be the best place to get some advise.

Firstly I've got a laptop (Asus G1) running Vista Ultimate 32bit (at the time prior to reinstall i had SP1).
Specs:
- Core 2 Duo 2.0Ghz
- 2GB Ram
- 5400 100GB HDD

On this laptop CodeBlocks runs very well. Compiles and links my console project very quickly (like 1-2 seconds max , with respect to the fact these projects are small)

I've recently custom built a home desktop computer running Windows XP SP3 with the following specs
- Core 2 Quad 2.83Ghz (Q9550)
- 3.25GB Ram (limited by Windows XP) 800Mhz (faster than the laptops)
- 7200RPM 500GB HDD
- Asus Motherboard (i think P5E with the latest BIOS revision)

and when compiling and linking a simple project, much to a similar size as that that I have compiled on the laptop it takes around 21 seconds all up. each file compiles slow then linking takes slightly longer overall.

Seeing as that my desktop is a substantial amount faster than my laptop it compiles code ever so slowly (This is also the case that if they were single core CPU's). Has anyone experienced a similar problem or issue before. I've got a feeling it may be a compatibility thing with the version of CodeBlocks and my CPU seeing that it is a newer CPU than what CodeBlocks 8.02 was supporting upon release.
Any help will be greatly appreciated.

I really hope it's not a hardware conflict, but hardware or software prob any advise will be greatly appreciated.

Thanks guys

Con

P.S. I've checked optimisations in the compiling settings to no avail so i'm kinda stuck. And may i mention that both systems are running the same install of CB with same settings etc.
P.S.S. Also my projects are compiled using the GCC Util basically running the MingW compiler for my work. (Apologise for any wrong terminologies used.)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compile & linking taking way too long.
« Reply #1 on: November 26, 2008, 12:57:08 pm »
I use a very similar computer for development (though I have a P5Q Pro and store compiler, headers, and libraries on solid state) and Code::Blocks certainly works very well with that configuration.

21 seconds is an awful lot for a small console project. To give a comparative number, when doing a clean rebuild of the Code::Blocks sources and forcing an abort after 21 seconds, my computer manages to compile and link the targets tinyXML, AutoRevision, ConsoleRunner, Squirrel, Squirrel stdlib, SqPlus, scintilla, wxFlatNotebook, and it finishes precompiling the entire SDK headers (it's caught by the abort while compiling the first 4-6 files of the SDK).

You should ensure that your libraries are in a "good" location, i.e. contiguous on disk, because the linker has to do a lot of reads. The same goes for the system headers. If you can afford a second drive, put compiler, headers, and libraries on one, sources and objects on another. If you can afford a solid state disk, buy one (for headers, libraries, compiler). If you can afford them, buy two and RAID them.
Check that parallel builds are enabled in the compiler options (rightmost tab) to take advantage of the 4 cores. The "correct" number of concurrent builds varies from system to system, a good start is cores + 1.
Make sure there is no malware scanning your disks all the time, turn off the Windows indexing and system restore services, and uninstall every possibly present shit like Kaspersky live protection or everything that starts with "Norton".
It is not sufficient to exclude your development files or even the whole partition from scans, because forementioned shit software still serializes every disk and network access through one process. It thus doesn't matter how many cores and disk spindles you have, or how fast they are.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compile & linking taking way too long.
« Reply #2 on: November 26, 2008, 01:02:59 pm »
....and, if you don't need these (most people don't), you can do a
fsutil behavior set disablelastaccess 1
fsutil behavior set disable8dot3 1


This is particularly wise for headers and libraries, even more so if they are stored on SSD (as reads are fast, but updates are painful and wear down the drive).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compile & linking taking way too long.
« Reply #3 on: November 26, 2008, 03:39:17 pm »
fsutil behavior set disable8dot3 1
Oh oh... I did that ones and you wouldn't believe how many apps still use the 8.3 notation and get very frustrated if these are missing suddenly. Be careful with that option.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Compile & linking taking way too long.
« Reply #4 on: November 26, 2008, 06:39:55 pm »
Hmm.... no apps that I use, apparently  8)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

kostaxtreme

  • Guest
Re: Compile & linking taking way too long.
« Reply #5 on: November 27, 2008, 04:43:28 am »
thanks for the prompt replies.
seeing that i'm not at home atm to try those physical fixes or even the software ones for that matter i can't comment on my findings (due to lack of).
i understand the concept and resoning behind using a seperate hdd, but seeing that it works on my lappy just fine is kinda having me believe there could be either some hardware software conflict.
mind you this is with practically a fresh install of windows xp with sp3 on it and it has been defragged.
i just can't quite get why my lappy runs it like it's nothing but my comp that is ever so much faster seems to be slower than a 486 (exaggeration).

also if i were to use those options the fsutil ones where do i enter those commands or settings. i'm totally new to the whole coding biz.

cheers guys,

con.