Click here to Skip to main content
15,887,999 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCBTProc not working Pin
S van Leent10-May-03 8:46
S van Leent10-May-03 8:46 
GeneralRe: CBTProc not working Pin
Ernest Laurentin10-May-03 14:31
Ernest Laurentin10-May-03 14:31 
GeneralRe: CBTProc not working Pin
S van Leent11-May-03 8:24
S van Leent11-May-03 8:24 
GeneralCost of a function call Pin
Shah Shehpori10-May-03 8:13
sussShah Shehpori10-May-03 8:13 
GeneralRe: Cost of a function call Pin
Michael Dunn10-May-03 8:50
sitebuilderMichael Dunn10-May-03 8:50 
GeneralRe: Cost of a function call Pin
Joe Woodbury10-May-03 9:18
professionalJoe Woodbury10-May-03 9:18 
GeneralRe: Cost of a function call Pin
S van Leent10-May-03 11:17
S van Leent10-May-03 11:17 
GeneralRe: Cost of a function call Pin
Joe Woodbury10-May-03 12:04
professionalJoe Woodbury10-May-03 12:04 
S van Leent wrote:
it really does matter pushing things on the stack or not

It MAY matter, performance wise. If speed is of most importance, a developer may choose to use the __fastcall modifier on functions. However, if speed is that important, you should always test your code, not simply presume it is faster one way over the other.

S van Leent wrote:
So I think a compiler should just inline when you want it to inline.

I totally disagree. The standard is quite correct in this regard. For convenience, or when using templates, developers may implement a member function in the header, either explicitly inline or within the body of the class definition. If all of those are automatically inlined, it will result in bloated code and may very well result in slower code. (Beyond CPU cycle counts, bloated code will result in more paging which will have a devastating effect on performance.)

In general, unless you really understand the CPU architecture, you should just write clean C/C++ code and let the compiler do it's thing.

Again, most performance bottlenecks are in a tiny part of the code and can often be fixed by using a better algorithm and in understanding and leveraging the OS better.
GeneralRe: Cost of a function call Pin
S van Leent11-May-03 8:17
S van Leent11-May-03 8:17 
GeneralRe: Cost of a function call Pin
Shah Shehpori11-May-03 5:16
sussShah Shehpori11-May-03 5:16 
GeneralRe: Cost of a function call Pin
Joe Woodbury11-May-03 6:10
professionalJoe Woodbury11-May-03 6:10 
GeneralRe: Cost of a function call Pin
Baris Kurtlutepe11-May-03 5:40
Baris Kurtlutepe11-May-03 5:40 
GeneralSocket Error Pin
Mazdak10-May-03 2:31
Mazdak10-May-03 2:31 
GeneralRe: Socket Error Pin
valikac10-May-03 5:42
valikac10-May-03 5:42 
GeneralRe: Socket Error Pin
Mazdak10-May-03 7:47
Mazdak10-May-03 7:47 
GeneralRe: Socket Error Pin
Anders Molin10-May-03 5:43
professionalAnders Molin10-May-03 5:43 
GeneralRe: Socket Error Pin
Mazdak10-May-03 7:48
Mazdak10-May-03 7:48 
GeneralRe: Socket Error Pin
Anders Molin10-May-03 9:18
professionalAnders Molin10-May-03 9:18 
GeneralRe: Socket Error Pin
Mazdak10-May-03 18:05
Mazdak10-May-03 18:05 
QuestionIs ++i statement in the for loop better than i++? Pin
Link260010-May-03 0:56
Link260010-May-03 0:56 
AnswerRe: Is ++i statement in the for loop better than i++? Pin
Tim Smith10-May-03 1:40
Tim Smith10-May-03 1:40 
GeneralRe: Is ++i statement in the for loop better than i++? Pin
Link260010-May-03 12:04
Link260010-May-03 12:04 
GeneralRe: Is ++i statement in the for loop better than i++? Pin
Joe Woodbury11-May-03 6:18
professionalJoe Woodbury11-May-03 6:18 
AnswerRe: Is ++i statement in the for loop better than i++? Pin
valikac10-May-03 5:43
valikac10-May-03 5:43 
AnswerRe: Is ++i statement in the for loop better than i++? Pin
Michael Dunn10-May-03 7:09
sitebuilderMichael Dunn10-May-03 7:09 

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.