Jump to content
  • Advertisement
Sign in to follow this  
godsenddeath

Does Adding Unnecessary Headers Slow a Program Down?

This topic is 4145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i was thinking of creating a header file that declares all the libraries and standard libraries i ever use, and just including that header into all my C++ stuff, does anyone know if including a a half dozen hears that arne't goinf to be used will cause any sort of lag?

Share this post


Link to post
Share on other sites
Advertisement
Nope...If you include a header and no function defined in it is called, then nothing additional will be compiled into the final binary.

Share this post


Link to post
Share on other sites
i don't think it will slow the program down but it will significantly increase the time it takes to compile

Share this post


Link to post
Share on other sites
oh ok, thanks

its kinda weird, i keeping waiting to be blasted for being a newbie but it never seems to happen, I like this place :)

Share this post


Link to post
Share on other sites
Quote:
Original post by godsenddeath
oh ok, thanks

its kinda weird, i keeping waiting to be blasted for being a newbie but it never seems to happen, I like this place :)


Around here people tend to be very understanding of new comers...We were all there at some point. Some people get upset at certain types of questions, but by and large, there is a lot of understanding.

Good luck to you.

Share this post


Link to post
Share on other sites
You might want to look into precompiled headers. If you have a lot of commonly used header files that don't change often (or ever), a PCH can be a very handy tool for speeding up your compile times and reducing the number of #includes you have to make.

Specifics on setting up a PCH depend on what compiler and IDE you use, but the Google search I linked should at least get you started.

Share this post


Link to post
Share on other sites
Quote:
Original post by tHiSiSbOb
Some people get upset at certain types of questions,

Namely, easy to google ones (which this certainly isn't)
Quote:
but by and large, there is a lot of understanding.

Especially when you post in the right forum. Anyone blasting on you for being a beginner in For Beginners is a forum-rules breaking idiot.

Good thread title, not an inane question, you (the OP) are in the clear -- you're asking questions the smart way :).

Share this post


Link to post
Share on other sites
Quote:
Original post by godsenddeath
oh ok, thanks

its kinda weird, i keeping waiting to be blasted for being a newbie but it never seems to happen, I like this place :)


That's just the kind of reaction I would expect from a n00b. ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!