Click here to Skip to main content
15,502,919 members
Articles / Programming Languages / C++
Alternative
Tip/Trick
Posted 25 Oct 2010

Tagged as

Stats

7.6K views
2 bookmarked

Reducing VisualStudio / C++ built times dramatically

Rate me:
Please Sign up or sign in to vote.
2.00/5 (1 vote)
25 Oct 2010CPOL
You could use internal and external include guards in your headers. This reduces compile time dramatically.
You could use internal and external include guards in your headers. This reduces compile time dramatically.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Germany Germany
Bye!
Andreas

http://www.aachen360.eu

Comments and Discussions

 
GeneralReason for my vote of 2 Not true. See iberg comment. Pin
Sauro Viti25-Oct-10 21:54
professionalSauro Viti25-Oct-10 21:54 
GeneralAs i see it the sole benefit of using external guards is to ... Pin
iberg25-Oct-10 7:58
iberg25-Oct-10 7:58 
As i see it the sole benefit of using external guards is to avoid opening a header file multiple times just for parsing the include guard. The same effect could be achieved with a "#pragma once" which should not require opening the file multiple times. However the project for which i ended up using the approach outlined here showed no sign of increased performance when using pragma once instead of classic include guards. The likely cause is that the preprocessor is already optimized in a way that it does not open a file multiple times even if internal include guards are used. If this is the case there should be no performance difference when using external guards cause this optimization is done by the preprocessor anyway.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.