User forums > Help
slooooow linking
thomas:
--- Quote from: zabzonk on October 25, 2009, 02:04:21 pm ---have you tried linking with your AV software disabled?
--- End quote ---
Antivirus software may indeed be the problem. In particular Kaspersky and Norten will make your computer practically unusable for development, they're as bad or worse than the malware that they presumably prevent.
I've been using Kaspersky because you get indefinite free licenses for it from some big computer magazine here, and surely something that's free can't be so bad that it doesn't warrant the price, can it? This assumption is wrong. Kaspersky will increase compile times by about 3/4 and will render quad-core CPUs as well as low-latency storage such as a SSD RAID entirely useless. On top of that, it will perform some kind of "deep scan" on new executables that run immediately after being created (such as 100% of everything that comes out the IDE when you develop, duh), which will freeze the computer for 15-20 seconds.
Linking can already be a daunting task if no security malware is breaking your computer, as the linker has to fetch a lot of random tiny fragments from many files. You may see noticeable speedups if you use a ramdisk or a SSD to host your library files.
zabzonk:
> Linking can already be a daunting task
Actually, my experience is that linking is almost always much faster than compilation and I try to organise my projects a set of libraries for this very reason. On my system, it takes approximately the same time to link a project of 45 object files, a couple of custom libraries and the standard libraries as it does to compile a couple of c++source files. Admittedly, my hardware is sclerotic, but I've seen the same thing on Solaris enterprise class servers.
thomas:
Funny how much figures differ.
My machine compiles about 5-10 non-trivial C++ source files per second, being mostly bound by process startup and file access. Linking can, depending on what's in the project, take anywhere from 1-2 seconds for a smallish project, and up to 45-60 seconds for something big.
zabzonk:
It seems to me that logically compiling should be slower than linking. Consider what a compiler has to do:
- open source file and shunt it through the preprocessor
- open all the #included header files - this will almost always be dozens and maybe hundreds
- parse the source from the files - this involves a lot of non-trivial pattern matching and database (symbol table) manipulation. If templates are used, their Turing-complete nature means that the compilation can take an arbitrary (or even infinite) amount of time.
- optimise the results of the parse
- write results to object file
- repeat for next source file
Compare this with the link process:
- open a relatively small number of files (all the .o files and libraries) These are in binary format and so do not need any sophisticated parsing
- look up code by name - for the libraries at least, there are indexes to speed this up
- fix up the code - a simple linear process
- write code to single executable file
This is much less computationally and I/O intensive than compiling and so should be faster. Of course, not all linkers are as smart as we would like them to be - people seem to prefer to work on compilers, for some strange reason :-), and linking cannot be as easily parallelised as the compilation process.
wilcomir:
hi everybody!
I've tried to disable my AV, but nothing happened. it always takes over a minute to link a file... any other ideas?
thank you!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version