PDA

View Full Version : Problem: the Application Takes very long time to build



Ma7moud El-Naggar
19th November 2010, 17:35
i have an app but some time it builds well and many time takes very very long time to build
i consume almost the processor time and it task manager i found that
there are many mingw32-make.exe
what is the reason and solution for this problem ??

tbscope
19th November 2010, 17:40
A possible reason:
A virus killer/spyware killer that is far too active.

high_flyer
19th November 2010, 17:48
It also depends on the size of your project and if you are re-building or just building.
With Qt even medium sized project on not very fast system can take some time to compile as the moc'ing also comes in.

When you rebuild, then all the temp fails, objects etc are deleted, and then everything needs to be compiled and built from the start again.
If you just changed something in a source file (not so with headers) then only that compilation unit will be compiled and linked to the already existing objects, which is much faster.

What tbscope mentioned is of course possible as well.

MarekR22
19th November 2010, 19:18
Another way to improve compilation is to build header files in smart way.
If it is only possible do not include header file from other header file just add forward declaration of class which is needed. This will speed up header file processing.

Ma7moud El-Naggar
19th November 2010, 20:33
first it is small project (6 forms and some classes)
i have avira anti virus
but i some time build fast as expected and many time didn't build but i wait it for long time
i can include my project if you interested to see it
thank you for your help

tbscope
20th November 2010, 07:26
When a project sometimes compiles fast and sometimes very slow, it most likely is not the compiler or the linker or any other tool used while building. There is a small change it is, but most likely it is a slowdown caused by other software. An indexer running in the background might slow it down, a virus killer, other tools accessing the files the compiler and linker need, ...

The biggest bottleneck in most home computers is I/O, and more specific the hard disk.When an indexer or virus killer is scanning the system, it looks for new files. It also might have some other restrictions to scan certain files, like timers etc... When scanning a file, a program might create a lock on those files, preventing the compiler or linker to proceed until the lock has been removed.

One suggestion is to build all the software in a specific folder. Then, in the index, virus killer, etc... set up this folder so it doesn't get scanned (if possible of course).