Click here to Skip to main content
15,905,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help with idea Pin
Andrew Walker6-Sep-03 14:45
Andrew Walker6-Sep-03 14:45 
GeneralRe: Need help with idea Pin
Steven M Hunt6-Sep-03 15:57
Steven M Hunt6-Sep-03 15:57 
GeneralNeed help doing a simple game, ttt Pin
Snyp6-Sep-03 13:15
Snyp6-Sep-03 13:15 
GeneralRe: Need help doing a simple game, ttt Pin
Steven M Hunt6-Sep-03 13:30
Steven M Hunt6-Sep-03 13:30 
GeneralSocks Sock Socks! Pin
ez_way6-Sep-03 10:34
ez_way6-Sep-03 10:34 
GeneralRe: Socks Sock Socks! Pin
Jörgen Sigvardsson6-Sep-03 11:31
Jörgen Sigvardsson6-Sep-03 11:31 
Generalprocessing headers more efficiently Pin
Jim Crafton6-Sep-03 8:13
Jim Crafton6-Sep-03 8:13 
GeneralRe: processing headers more efficiently Pin
Andrew Walker6-Sep-03 15:07
Andrew Walker6-Sep-03 15:07 
Jim Crafton wrote:
Which is more efficient (a) or (b)?
It probably won't make a noticable difference.

Jim Crafton wrote:
I am using a fair amount of templates and some preprocessor stuff to add the extra RTTI support the framework uses. Does this make a big difference in compile times?
Templatised code, especially when it changes frequently and is #included a lot can be a big killer. If you can, factor as much code from the template classes into base classes.

I've listed some other ideas. Top to bottom in priority of things to try.

Ensure that you aren't changing code in header files that are frequently included. This can be one of the biggest compile time killers. Also make sure you don't #include code you that you don't need. Use the pImpl idiom, use forward declarations, etc.
See items 26-30 from Herb Sutter's book 'Exceptional C++' for a really good explanation of this.

If you're using a microsoft compiler you might think about using #pragma once.
MSDN:
"Specifies that the file, in which the pragma resides, will be included (opened) only once by the compiler in a build."

From what I've read you may also juice a little more performance out by putting the include guard in the cpp file - I haven't tried this myself, but it might be worth a bit of research.



If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.

Rudyard Kipling

GeneralRe: processing headers more efficiently Pin
Jim Crafton7-Sep-03 6:17
Jim Crafton7-Sep-03 6:17 
GeneralRe: processing headers more efficiently Pin
Serge Krynine8-Sep-03 0:18
Serge Krynine8-Sep-03 0:18 
GeneralUnderstanding HEAP: Free Heap block errors Pin
Jim Crafton6-Sep-03 7:34
Jim Crafton6-Sep-03 7:34 
GeneralRe: Understanding HEAP: Free Heap block errors Pin
Rama Krishna Vavilala6-Sep-03 11:05
Rama Krishna Vavilala6-Sep-03 11:05 
GeneralRe: Understanding HEAP: Free Heap block errors Pin
Jim Crafton6-Sep-03 11:08
Jim Crafton6-Sep-03 11:08 
QuestionFastest Text api? Pin
Roggan6-Sep-03 7:18
Roggan6-Sep-03 7:18 
GeneralSendMessage() Pin
lpRomang6-Sep-03 5:44
lpRomang6-Sep-03 5:44 
GeneralRe: SendMessage() Pin
Michael Dunn6-Sep-03 5:58
sitebuilderMichael Dunn6-Sep-03 5:58 
QuestionCView in DLL, CDocument in EXE :: How to share? Pin
clintsinger6-Sep-03 5:40
clintsinger6-Sep-03 5:40 
QuestionRegDeleteValue with REG_MULTI_SX/MoveFileEx? Pin
Kayembi6-Sep-03 5:16
Kayembi6-Sep-03 5:16 
AnswerRe: RegDeleteValue with REG_MULTI_SX/MoveFileEx? Pin
Kayembi7-Sep-03 2:35
Kayembi7-Sep-03 2:35 
GeneralRe: RegDeleteValue with REG_MULTI_SX/MoveFileEx? Pin
Kayembi7-Sep-03 3:49
Kayembi7-Sep-03 3:49 
GeneralSet the Bk color of a list ctrl Pin
Md Saleem Navalur6-Sep-03 3:07
Md Saleem Navalur6-Sep-03 3:07 
GeneralRe: Set the Bk color of a list ctrl Pin
valikac6-Sep-03 5:07
valikac6-Sep-03 5:07 
GeneralRe: Set the Bk color of a list ctrl Pin
Michael Dunn6-Sep-03 6:05
sitebuilderMichael Dunn6-Sep-03 6:05 
GeneralRe: Set the Bk color of a list ctrl Pin
Jörgen Sigvardsson6-Sep-03 11:33
Jörgen Sigvardsson6-Sep-03 11:33 
GeneralRe: Set the Bk color of a list ctrl Pin
Anthony_Yio7-Sep-03 0:24
Anthony_Yio7-Sep-03 0:24 

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.