90 likes | 189 Views
Adaptive Optimization in the Jalape ñ o JVM. M. Arnold et al. Presented by D. Spoonhower 5 March 2003. Background. Why JIT? Performance Safety JIT vs. Adaptive Cost/benefit analysis Feedback-driven JRVM: Compile-only Compare to HotSpot, et al. JRVM: “99%” Java
E N D
Adaptive Optimization in the Jalapeño JVM M. Arnold et al. Presented by D. Spoonhower 5 March 2003
Background • Why JIT? • Performance • Safety • JIT vs. Adaptive • Cost/benefit analysis • Feedback-driven • JRVM: Compile-only • Compare to HotSpot, et al. • JRVM: “99%” Java • Modular design, simple implementation • Self-optimizing
Jalapeño AOS Overview • Sampling-independent, e.g. • Hardware monitors • Invocation counters • Path profiles • Multiple optimization levels • Baseline – no register allocation • OptLevel0 – “on-the-fly” • OptLevel1 – flow-based • OptLevel2 – SSA (w/ arrays) • Profiling-based optimizations • Simple heuristics
AOS Architecture • Runtime Measurement System • Raw data collection • “Organizers” • Controller • Direct measurement • Including intrusive profiling • Manage recompilation • Recompilation System • Plan = optimization + profiling data + instrumentation • AOS Database
Recompilation: Sampling • Invocation count • Sample at context switch • Yield points in prologues and back edges • Low overhead • Setup: • Method listener • Hot method & decay organizers • Adaptive threshold • Set sample size • Set hotness threshold
Recompilation:Cost/Benefit Analysis For each method m at opt level i: • Ti, future running time of m • Cj, cost to recompile to level j, for i≤ j ≤ N • Tj, future running time of m if recompiled at level j Choose j to minimize Cj + Tj and ensure that Cj + Tj < Ti
Recompilation:Estimates • Program will execute for twice current duration, Tf= total future time • Sample to predict percent of time used by m (Pm) and compute: Ti = Tf * Pm • Offline measurements for speedup: Tj = Ti * Si / Sj • Use offline configuration of Cj
Feedback-directed Inlining • Approximate dynamic call graph • Listener samples in prologue • Caller + call site + callee • Adaptive threshold • Start high and decay • Estimate benefit: boost factor • Fraction of dynamic calls at site • Offline analysis of inlining • Correctness?
Opportunities • New measurements? • Alias tracking? • New optimization? • arraycheck or castcheck? • New cost analysis? • CPU utilization? • Fewer configuration parameters? • Source available at: http://www.research.ibm.com/jalapeno/ (Now called “Jikes RVM”)