6 Replies - 6663 Views - Last Post: 14 December 2012 - 09:21 AM
Posted 04 August 2012 - 12:40 AM
Does having many #includes affect run-time performances in any way? should I avoid using many #includes (when they're not really necessary, but could help) for some reason rather then the affect it has on compilation time?
For example: would it make sense to include a whole library for one function when you could re-invent the wheel at the cost of a few minutes?
Replies To: #include
Posted 04 August 2012 - 07:11 AM
Posted 04 August 2012 - 08:04 AM
and now that I think about it, that would only be the case if a lot of static/inline non-template functions were defined in the header; something that's already bad practice.
This post has been edited by ishkabible: 04 August 2012 - 08:07 AM
Posted 04 August 2012 - 10:32 PM
Consider accidentally including a header file that has lines like this:
#define malloc(_x) (OutputDebugString(__FUNCTION__), malloc(_x))
Or a header that says:
#define DEBUG #define _DEBUG #undef NDEBUG
I've spent time chasing down one of the latter trying to figure out why a program that was running well suddenly slowed down.
Posted 13 December 2012 - 04:00 PM
would run faster than say:
Posted 14 December 2012 - 09:21 AM
2. As has been established it's not really going to effect performance.