c++ - How to speed up g++ compile time (when using a lot of templates) -
This question is probably strange in some way, but how can I compile the G + time? My C ++ code heavily uses and promotes templates I already exits from header files and use the Jay-J option, but still it takes a while to compile (and link) it.
Is there a tool that analyzes my code and tell the bottle neck for the compiler? Or can any one profile compile the running on my code? It would be really good, because sometimes I have the impression that I spent a lot of time on the compiler console log ...
What is most useful to me:
- Creating a RAM filesystem is trivial on Linux. You can also copy (like precompile or actual .h file) of the same header files. RAM files can be placed on the system.
- I have a copy (major) library (like Boost, QT, Stadlib).
- Wherever possible, declaration rather than inclusion of classes is less dependent, thus the number of files is reduced which require reader when you change the header file.
- This usually helps on a case-by-case basis, but I have to make
-j3
globally to make sure the dependence graph in your makefile is correct. Yes, though, or you may have problems. - If you are using speed of execution or code size (and you are not testing, use
-O0
) The computer is fast enough for you (probably about small display hits Do not pay much attention to it). - Every time you save some people do not like it, but it allows you to see the errors quickly and can be done in the background, when you write And when you are ready for the test, you can Jars have to.
Comments
Post a Comment