Java method inlining performance considerations

Method inlining can significantly improve method call performance. Any method that is final is a potential candidate for inlining.

The inline feature is available on the iSeries™ server through the javac -o option at compilation time. The size of your class files and transformed Java™ program increases if you use the javac -o option. You should consider both the space and performance characteristics of your application when using the -o option.

Note: In general, it is best to not use the -o option of javac but instead leave inlining to later phases.

The Java transformer enables inlining for optimization level 30 and optimization level 40. Optimization level 30 enables some inlining of final methods within a single class. Optimization level 40 enables inlining of final methods within a ZIP file or JAR file. You can control method inlining with the AllowInlining and NoAllowInlining LICOPT parameter strings. The iSeries interpreter does not perform method inlining.

The Just-In-Time (JIT) compiler also performs inlining of most final methods. This is done automatically whenever the JIT compiler is active and it determines that inlining will be beneficial.

Related concepts
Java event trace performance tools
Java performance considerations
Java garbage collection
Java Native Method Invocation performance considerations
Java exception performance considerations
Java call trace performance tools
Java profiling performance tools
Related tasks
Collect Java performance data