Registered Member
|
Hi all -
We recently switched from my home-rolled vector/matrix library to Eigen in our code base. For the most part, all is well, but we have a couple of issues: Compile time is MUCH slower than before. I think it can take several times longer to build our code from scratch. There are some obvious things around reducing header dependencies that we may be able to capitalize on, but in general, have you found any ways to speed up compilations? I'm not so sure that precompiled headers would work well with expression templates... But if you've had luck with that, please speak up. Debug mode is nearly unbearably slow now. Probably a factor of 30 or 40 instead of 8 or 10 as before. Any hints for faster debug code? Thanks! |
Registered Member
|
A few hints:
- Optimization takes time, so use -O0 as long as you're just testing. - Precompiled headers may help, but I'm guessing for Eigen not much. - Use latest gcc. - Use a RAM-Disk to reduce IOWait (trivial under Linux), although that usually won't be the problem. - If it's unbearable, use several machines and distcc. |
Registered Member
|
Hi,
we are having the same problems with MSVC. Precompiled headers help a lot though I am using the scarcely since they are somewhat tricky to setup. IIRC, the /LTCG flag also causes a huge overhead in link time but on the other hand-side the generated code is more efficient. With MSVC you typically see the linker stall for several minutes (yes, minutes) on "Generating code ..." which is mostly related to /LTCG. The compile times in debug mode are fine though you have the aforementioned run-time impact. Another thing I have read (I think in the boost Geometry docs) is setting _SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0. I am not sure about these and have not tested them myself. HTH, Hauke |
Registered Member
|
For running your code in debug mode, you could
|
Moderator
|
For debuging without a significant slowdown, you can try with -g2 -O1. For the compilation time issue, precompiled headers help a lot on Linux too. You need gcc 4.3 or greater to really get compilation time improvements.
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]