• Create Account

### #20uglybdavis  Members   -  Reputation: 647

Like
1Likes
Like

Posted 10 September 2012 - 11:10 AM

I didn't read trough the whole thread, sorry if someone already answered this. You obviously use header protection #ifndef or #pragma so the contents of the header is only included once. Lets say you have the following two lines in the same file (unlikely, but entertain me)
The contents of header.h was included once, but the header.h file was opened twice (expensive). the easy (and ugly to read) workaround for this is:
Assuming _H_HEADERH_ is the #ifdef guard defined in header.h. This is an oversimplified example, but you can see how it helps. Back in my college days adding this to my final project reduced our compile time from 16 minutes down to about 10.

Disclaimer, i now have an SSD macbook, and this trick does very little to help compile times.
Lesson: hard-disk reads are expensive when there is an actual disk involved.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS