Ibm just-In-Time Compiler (jit) for Java: Best Practices and Coding Guidelines for improving Performance



Yüklə 153,14 Kb.
Pdf görüntüsü
səhifə1/7
tarix07.11.2018
ölçüsü153,14 Kb.
#78937
  1   2   3   4   5   6   7


 

 

 



IBM Just-In-Time Compiler (JIT) for Java  

Best practices and coding guidelines for improving performance 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pramod Ramarao 

Joran Siu 

Pavan Pamula 

 

Contributors: Vijay Sundaresan, Patrick Doyle, Graham Chapman 

 

IBM Software Group 

IBM Systems & Technology Group 

 

November 2008 

© Copyright IBM Corporation, 2008. 

 



 

 

 



Table of contents 

Abstract........................................................................................................................................1

 

Introduction .................................................................................................................................1

 

JIT technology.............................................................................................................................2

 

Compilation happens during run time ...................................................................................................... 2



 

Strategy: Focus optimization effort on important code .................................................................... 2

 

Inlining...................................................................................................................................................... 3



 

Strategy: Aggressively inline method calls ...................................................................................... 3

 

Virtual and interface methods .................................................................................................................. 3



 

Strategy: Devirtualize as many call sites as possible ...................................................................... 3

 

Heap allocations ...................................................................................................................................... 4



 

Strategy: Optimize for object locality................................................................................................ 4

 

Java coding guidelines...............................................................................................................5

 

Object allocations..................................................................................................................................... 5



 

Guideline: Avoid creating objects inside loops ................................................................................ 5

 

Guideline: Minimize object allocations, if possible........................................................................... 7



 

Guideline: Use immutable fields ...................................................................................................... 8

 

Methods ................................................................................................................................................... 8



 

Guideline: Keep methods small ....................................................................................................... 8

 

Guideline: Use exceptions and reflection rarely .............................................................................. 9



 

Loops ..................................................................................................................................................... 10

 

Guideline: Do not modify the loop bounds within the loop body.................................................... 10



 

Guideline: Increment the loop index by a single value across all paths ........................................ 12

 

Guideline: Make loops as compact as possible ............................................................................. 13



 

Guideline: Use locals instead of fields or static variables, where possible.................................... 13

 

Guideline: System.arraycopy() is well-optimized by the JIT .......................................................... 13



 

Guideline: TRJIT can also optimize special loops such as memset and array translate............... 14

 

Synchronization ..................................................................................................................................... 15



 

Tuning ........................................................................................................................................16

 

Tuning application code ........................................................................................ 16



 

Tuning JVM parameters ........................................................................................ 16

 

Tuning the garbage collector ................................................................................. 16



 

Tuning JVM parameters for application startup......................................................... 17

 

Diagnostic techniques and tools available for performance problems ........................... 18



 

Summary....................................................................................................................................18

 

Footnotes ...................................................................................................................................19

 

Resources ..................................................................................................................................20

 

About the authors .....................................................................................................................21

 

Trademarks and special notices..............................................................................................22

 

 



IBM Just-In-Time Compiler (JIT) for Java 

Best practices and coding guidelines for improving performance 


Yüklə 153,14 Kb.

Dostları ilə paylaş:
  1   2   3   4   5   6   7




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə