Click here to Skip to main content
12,630,949 members (32,625 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

4.5K views
2 bookmarked
Posted

Reducing VisualStudio / C++ built times dramatically

, 25 Oct 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
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)

Share

About the Author

Andreas Schniertshauer
Software Developer
Germany Germany
Bye!
Andreas

http://www.aachen360.eu

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralReason for my vote of 2 Not true. See iberg comment. Pin
Sauro Viti25-Oct-10 21:54
memberSauro Viti25-Oct-10 21:54 
GeneralAs i see it the sole benefit of using external guards is to ... Pin
iberg25-Oct-10 7:58
memberiberg25-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.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.161205.3 | Last Updated 25 Oct 2010
Article Copyright 2010 by Andreas Schniertshauer
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid