Characterization of call-graph profiles in Java workloads

Method inlining is a standard optimization in optimizing compilers. Java Just-In-Time (JIT) compilers use a size threshold for their inlining decisions. They favor inlining methods that are smaller than the threshold and do not inline the other larger methods. This has been a simple and effective strategy, but we should be able to make even better inlining based on a cost-benefit model, assuming accurate and lightweight call-graph profiles. We characterized the call-graph profiles of twelve SPECjvm2008 benchmarks with two metrics, method size and call frequency, to study the opportunities that make better tradeoff between performance benefits and compilation costs over the existing size-based inlining algorithm in the dynamic compilation environment. We found that inlining methods that are smaller than a size threshold is not always beneficial for performance. Most of the call-graph edges to the small methods had quite low call frequencies. Excluding the low-weighted call-graph edges from inlining can be an opportunity to reduce the compilation cost. On the other hand, a few call-graph edges to the methods that are larger than the threshold had high call frequencies. Inlining the highly-weighted call-graph edges can be an opportunity to improve performance. We developed a new cost-benefit-based inlining algorithm to capture those identified opportunities and to make inlining decisions more cost effective. Our evaluation showed that the new algorithm improves performance significantly while reduces the compilation cost, compared to the widely-used size-based inlining algorithm.

[1]  Dhruva R. Chakrabarti,et al.  Inline analysis: beyond selection heuristics , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[2]  Narayanan Vijaykrishnan,et al.  Java Runtime Systems: Characterization and Architectural Implications , 2001, IEEE Trans. Computers.

[3]  Michael F. P. O'Boyle,et al.  Automatic Tuning of Inlining Heuristics , 2005, ACM/IEEE SC 2005 Conference (SC'05).

[4]  Sameer Kulkarni,et al.  Automatic construction of inlining heuristics using machine learning , 2013, Proceedings of the 2013 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[5]  Matthew Arnold,et al.  Adaptive optimization in the Jalapeno JVM , 2000, SIGP.

[6]  C. R. Ramakrishnan,et al.  Evaluating Inlining Techniques , 1998, Comput. Lang..

[7]  José Nelson Amaral,et al.  To Inline or Not to Inline? Enhanced Inlining Decisions , 2003, LCPC.

[8]  Fadi Busaba,et al.  IBM zEC12: The Third-Generation High-Frequency Mainframe Microprocessor , 2013, IEEE Micro.

[9]  Nikola Grcevski,et al.  Java Just-in-Time Compiler and Virtual Machine Improvements for Server and Middleware Applications , 2004, Virtual Machine Research and Technology Symposium.

[10]  Toshiaki Yasue,et al.  Design, implementation, and evaluation of optimizations in a just-in-time compiler , 1999, JAVA '99.

[11]  Scott A. Mahlke,et al.  Profile‐guided automatic inline expansion for C programs , 1992, Softw. Pract. Exp..

[12]  Matthew Arnold,et al.  A Survey of Adaptive Optimization in Virtual Machines , 2005, Proceedings of the IEEE.

[13]  Toshiaki Yasue,et al.  An Empirical Study of Method In-lining for a Java Just-in-Time Compiler , 2002, Java Virtual Machine Research and Technology Symposium.

[14]  James F. Power,et al.  A Method-Level Analysis of Object-Oriented Techniques in Java Applications , 2002 .

[15]  Matthew Arnold,et al.  Collecting and exploiting high-accuracy call graph profiles in virtual machines , 2005, International Symposium on Code Generation and Optimization.