avoiding function calls by inline source code

Hello,

I’m trying to speed up an application. And I’ve heard that it was
possible to insert “source” lines rather than function calls. So the
jumps could be avoided at the cost of memory consumation for my program.

Does anybody know how to configure the compiler (some hidden switches or
so) to automatically insert not the function calls but rather the source
lines while compiling the application?

Thanks.

Winfried

If you declare function as inline it should do it. That only works within a
C file though, this is resolved at compile time and not at link time.

Unless your function is very short, sometimes it doesn’t make that big of a
difference and can in some instances make it worst

“Winfried Böske” <winfriedboeske@yahoo.de> wrote in message
news:3FCF2D01.9010008@yahoo.de

Hello,

I’m trying to speed up an application. And I’ve heard that it was
possible to insert “source” lines rather than function calls. So the
jumps could be avoided at the cost of memory consumation for my program.

Does anybody know how to configure the compiler (some hidden switches or
so) to automatically insert not the function calls but rather the source
lines while compiling the application?

Thanks.

Winfried

Winfried B?ske <winfriedboeske@yahoo.de> wrote:
WBs > Hello,

WBs > I’m trying to speed up an application. And I’ve heard that it was
WBs > possible to insert “source” lines rather than function calls. So the
WBs > jumps could be avoided at the cost of memory consumation for my program.

WBs > Does anybody know how to configure the compiler (some hidden switches or
WBs > so) to automatically insert not the function calls but rather the source
WBs > lines while compiling the application?

WBs > Thanks.

WBs > Winfried

If it’s a C++ program just stick ‘inline’ in front of your function. I.E.

inline int my_function ( )
{
// do something impressive
return something;
}

int main ( )
{
my_function();
}

In this program, there is no call to my_function. The code for
my_function is just copied inline to function main().


Bill Caroselli – Q-TPS Consulting
1-(708) 308-4956 <== Note: New Number
qtps@earthlink.net