Examples of using Inlining in English and their translations into Serbian
{-}
-
Colloquial
-
Ecclesiastic
-
Computer
-
Latin
-
Cyrillic
Hence inlining is best for small functions that are called often.
A survey of the modest academic literature on inlining from the 1980s and 1990s is given in Jones& Marlow 1999.
Inlining is an important optimization, but has complicated effects on performance.
Smarter compilers(such as Glasgow Haskell Compiler)will track this, but naive inlining loses this information.
With inlining, control drops through directly to the code for the function, without a branch or call instruction.
Once the compiler has decided toinline a particular function, performing the inlining operation itself is usually simple.
Thus inlining may be minimized or eliminated if optimizing for code size, as is often the case in embedded systems.
Any mutual recursion between two procedures can be converted to direct recursion by inlining the code of one procedure into the other.
Run-time inlining can use dynamic profiling information to make better decisions about which functions to inline, as in the Java Hotspot compiler.
If the code in the body of the loop involves function calls,it may not be possible to combine unrolling with inlining, since the increase in code size might be excessive.
Although it can lead to larger executables,aggressive inlining has nevertheless become more and more desirable as memory capacity has increased faster than CPU speed.
For small cache sizes(much smaller than the working set prior to expansion),the increased sequentiality dominates, and inlining improves cache performance.
These can be done without inlining, but require a significantly more complicated compiler and linker(in case caller and callee are in separate compilation units).
This translation may be useful when any of the mutually recursive procedures can be called by outside code,so there is no obvious case for inlining one procedure into the other.
A method used to eliminate this overhead is inline expansion or inlining of the subprogram's body at each call site(versus branching to the subroutine and back).
Inlining however, will usually increase the code size, unless the program contains only one call to the subroutine, or the subroutine body is less code than the call overhead.
In an actual C application,it would be preferable to use an inlining language feature such as parameterized macros or inline functions to tell the compiler to transform the code in this way.
Inlining is a critical optimization in functional languages and object-oriented programming languages, which rely on it to provide enough context for their typically small functions to make classical optimizations effective.
Optimizations that cross function boundaries can be done without requiring interprocedural optimization(IPO):once inlining has been performed, additional intraprocedural optimizations("global optimizations") become possible on the enlarged function body.
As a rule of thumb, some inlining will improve speed at very minor cost of space, but excess inlining will hurt speed, due to inlined code consuming too much of the instruction cache, and also cost significant space.
In lower-level imperative languages such as C and Fortran it is typically a 10- 20% speed boost, with minor impact on code size, while in more abstract languages it can be significantly more important,due to the number of layers inlining removes, with an extreme example being Self, where one compiler saw improvement factors of 4 to 55 by inlining. .
The GNU GCC compiler has function inlining, which is turned on by default at -O3, and can be turned on manually via passing the switch(-finline-functions) at compile time.
Normally, optimizations are performed on a per module,"compiland", basis; but this approach, while easier to write and test and less demanding of resourcesduring the compilation itself, does not allow certainty about the safety of a number of optimizations such as aggressive inlining and thus cannot perform them even if they would actually turn out to be efficiency gains that do not change the semantics of the emitted object code.