An Empirical Study on Deoptimization in the Graal Compiler

Authors Yudi Zheng, Lubomír Bulej, Walter Binder



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2017.30.pdf
  • Filesize: 0.72 MB
  • 30 pages

Document Identifiers

Author Details

Yudi Zheng
Lubomír Bulej
Walter Binder

Cite AsGet BibTex

Yudi Zheng, Lubomír Bulej, and Walter Binder. An Empirical Study on Deoptimization in the Graal Compiler. In 31st European Conference on Object-Oriented Programming (ECOOP 2017). Leibniz International Proceedings in Informatics (LIPIcs), Volume 74, pp. 30:1-30:30, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2017)
https://doi.org/10.4230/LIPIcs.ECOOP.2017.30

Abstract

Managed language platforms such as the Java Virtual Machine or the Common Language Runtime rely on a dynamic compiler to achieve high performance. Besides making optimization decisions based on the actual program execution and the underlying hardware platform, a dynamic compiler is also in an ideal position to perform speculative optimizations. However, these tend to increase the compilation costs, because unsuccessful speculations trigger deoptimization and recompilation of the affected parts of the program, wasting previous work. Even though speculative optimizations are widely used, the costs of these optimizations in terms of extra compilation work has not been previously studied. In this paper, we analyze the behavior of the Graal dynamic compiler integrated in Oracle's HotSpot Virtual Machine. We focus on situations which cause program execution to switch from machine code to the interpreter, and compare application performance using three different deoptimization strategies which influence the amount of extra compilation work done by Graal. Using an adaptive deoptimization strategy, we managed to improve the average start-up performance of benchmarks from the DaCapo, ScalaBench, and Octane benchmark suites, mostly by avoiding wasted compilation work. On a single-core system, we observed an average speed-up of 6.4% for the DaCapo and ScalaBench workloads, and a speed-up of 5.1% for the Octane workloads; the improvement decreases with an increasing number of available CPU cores. We also find that the choice of a deoptimization strategy has negligible impact on steady-state performance. This indicates that the cost of speculation matters mainly during start-up, where it can disturb the delicate balance between executing the program and the compiler, but is quickly amortized in steady state.
Keywords
  • dynamic compiler
  • profile-guided optimization
  • deoptimization

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Matthew Arnold, Stephen J. Fink, David Grove, Michael Hind, and Peter F. Sweeney. A Survey of Adaptive Optimization in Virtual Machines. Proceedings of the IEEE, 93(2):449-466, 2005. Google Scholar
  2. Matthew Arnold, Michael Hind, and Barbara G. Ryder. Online Feedback-directed Optimization of Java. In Proc. 17th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA 2002, pages 111-129. ACM, 2002. Google Scholar
  3. Stephen M. Blackburn, Robin Garner, Chris Hoffmann, Asjad M. Khang, Kathryn S. McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z. Guyer, Martin Hirzel, Antony Hosking, Maria Jump, Han Lee, J. Eliot B. Moss, Aashish Phansalkar, Darko Stefanović, Thomas VanDrunen, Daniel von Dincklage, and Ben Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In Proc. ACM SIGPLAN International Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA 2006, pages 169-190. ACM, 2006. Google Scholar
  4. Dries Buytaert, Andy Georges, Michael Hind, Matthew Arnold, Lieven Eeckhout, and Koen De Bosschere. Using Hpm-sampling to Drive Dynamic Compilation. In Proc. 22nd ACM SIGPLAN Conference on Object-oriented Programming, Systems and Applications, OOPSLA 2007, pages 553-568. ACM, 2007. Google Scholar
  5. Craig Chambers and David Ungar. Making pure object-oriented languages practical. In Proc. ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA 1991, pages 1-15. ACM, 1991. Google Scholar
  6. L. Peter Deutsch and Allan M. Schiffman. Efficient Implementation of the Smalltalk-80 System. In Proc. 11th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1984, pages 297-302. ACM, 1984. Google Scholar
  7. S. J. Fink and Feng Qian. Design, Implementation and Evaluation of Adaptive Recompilation with On-stack Replacement. In Proc. IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2003, pages 241-252. IEEE Computer Society, March 2003. Google Scholar
  8. Google. Octane 2.0 JavaScript Benchmark. URL: https://developers.google.com/octane/.
  9. Dayong Gu and Clark Verbrugge. Phase-based Adaptive Recompilation in a JVM. In Proc. 6th IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2008, pages 24-34. ACM, 2008. Google Scholar
  10. Urs Hölzle, Craig Chambers, and David Ungar. Debugging Optimized Code with Dynamic Deoptimization. In Proc. ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 1992, pages 32-43. ACM, 1992. Google Scholar
  11. Urs Hölzle and David Ungar. Reconciling Responsiveness with Performance in Pure Object-oriented Languages. ACM Trans. Program. Lang. Syst., 18(4):355-400, July 1996. Google Scholar
  12. Madhukar N. Kedlaya, Behnam Robatmili, Cġlin Caşcaval, and Ben Hardekopf. Deoptimization for Dynamic Language JITs on Typed, Stack-based Virtual Machines. In Proc. 10th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, VEE 2014, pages 103-114. ACM, 2014. Google Scholar
  13. Donald E. Knuth. Structured Programming with Go to Statements. ACM Comput. Surv., 6(4):261-301, December 1974. Google Scholar
  14. Thomas Kotzmann, Christian Wimmer, Hanspeter Mössenböck, Thomas Rodriguez, Kenneth Russell, and David Cox. Design of the Java HotSpottrademark Client Compiler for Java 6. ACM Trans. Archit. Code Optim., 5(1):7:1-7:32, May 2008. Google Scholar
  15. Chandra J. Krintz, David Grove, Vivek Sarkar, and Brad Calder. Reducing the Overhead of Dynamic Compilation. Software: Practice and Experience, 31(8):717-738, 2001. Google Scholar
  16. Prasad Kulkarni, Matthew Arnold, and Michael Hind. Dynamic Compilation: The Benefits of Early Investing. In Proc. 3rd International Conference on Virtual Execution Environments, VEE 2007, pages 94-104. ACM, 2007. Google Scholar
  17. Prasad A. Kulkarni. JIT Compilation Policy for Modern Machines. In Proc. ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2011, pages 773-788. ACM, 2011. Google Scholar
  18. Oracle. Graal project. URL: http://openjdk.java.net/projects/graal/.
  19. Michael Paleczny, Christopher Vick, and Cliff Click. The Java HotSpottrademark Server Compiler. In Proc. Symposium on Java Virtual Machine Research and Technology Symposium - Volume 1, JVM 2001, pages 1-1. USENIX Association, 2001. Google Scholar
  20. Andreas Sewe, Mira Mezini, Aibek Sarimbekov, and Walter Binder. Da Capo con Scala: Design and Analysis of a Scala Benchmark Suite for the Java Virtual Machine. In Proc. ACM International Conference on Object Oriented Programming, Systems, Languages and Applications, OOPSLA 2011, pages 657-676. ACM, 2011. Google Scholar
  21. Toshio Suganuma, Toshiaki Yasue, Motohiro Kawahito, Hideaki Komatsu, and Toshio Nakatani. Design and Evaluation of Dynamic Optimizations for a Java Just-in-time Compiler. ACM Trans. Program. Lang. Syst., 27(4):732-785, July 2005. Google Scholar
  22. John Whaley. Partial Method Compilation Using Dynamic Profile Information. In Proc. 16th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA 2001, pages 166-179. ACM, 2001. Google Scholar
  23. Christian Wimmer, Vojin Jovanovic, Erik Eckstein, and Thomas Würthinger. One Compiler: Deoptimization to Optimized Code. In Proc. 26th International Conference on Compiler Construction, CC 2017, pages 55-64. ACM, 2017. Google Scholar
  24. Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Gregor Richards, Doug Simon, and Mario Wolczko. One VM to Rule Them All. In Proc. ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming &Software, Onward! 2013, pages 187-204. ACM, 2013. Google Scholar
  25. Toshiaki Yasue, Toshio Suganuma, Hideaki Komatsu, and Toshio Nakatani. An Efficient Online Path Profiling Framework for Java Just-In-Time Compilers. In Proc. 12th International Conference on Parallel Architectures and Compilation Techniques, PACT 2003, pages 148-158. IEEE Computer Society, 2003. Google Scholar
  26. Yudi Zheng, Lubomír Bulej, and Walter Binder. Accurate Profiling in the Presence of Dynamic Compilation. In Proc. ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, pages 433-450. ACM, 2015. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail