ILE C/C++ Programmer's Guide

Inlining Function Calls

When a function is called in a few places but executed many times, changing the function to an inline function typically saves many function calls and results in performance improvement. You might be able to improve performance by changing function calls to inline functions or macro expressions, provided such a change does not increase the size of the program object and cause enough page faults to slow the program down. To optimize performance, strike a balance between program size and inlining or macro expressions. See Table 6.

Note:
C++ language only In C++, macro expressions are not recommended. Instead, use the inline keyword and turn on inlining.

The INLINE compile-time option allows you to request that the compiler replace a function call with that function's code in place of the function call. If the compiler allows the inlining to take place, the function call is replaced by the machine code that represents the source code in the function definition.

Inlining is a method that allows you to improve the run-time performance of a C or C++ program by eliminating the function call overhead. Inlining allows for an expanded view of the program for optimization. Exposing constants and flow constructs on a global scale allows the compiler to make better choices during optimization.

For information about inlining and expanding macros, see:


[ Top of Page | Previous Page | Next Page | Table of Contents ]