IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesJava  Print This     

Inlining (Java and Delphi Cross Reference Guide)

By Mike Prestwood

Java versus Delphi: A side by side comparison between Java and Delphi.

 
Language Details
 

Language Details is kind of a catch all for stuff that didn't make it into language basics nor any other category.

Inlining

[Other Languages] 

General Info: Inline Routines

Instead of calling a routine, you move the code from the routine itself and expand it in place of the call. In addition to manual inlining, some languages support automatic inlining where the compiler or some other pre-compiler decides when to inline a code routine. Also, some languages allow for developer defined inlining where the developer can suggest and/or force the inlining of a code routine. Inlining can optimize your code for speed by saving a call and return, and parameter management.

Languages Focus

Does it support inlining? If so, does it support developer defined inlining? Does it support automatic inlining? Both?

Java:   Automatic

The Java compiler automatically inlines when it determines  a benefit. The use of final methods is considered a compiler hint to tell the compiler to inline the method if beneficial.

More Info / Comment
Delphi:   Inline

Delphi introduced developer defined function and procedure inlining with Delphi 2005. Use the inline keyword to tell the compiler to try to inline a routine (a compiler hint). Since Delphi will only try to inline the routine, make sure you test for speed because inlining a routine can lead to slower code under some circumstances.

Syntax Example:  
function Add(a, b: Integer): Integer; inline;
begin
end;












Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]