Taking a Closer Look: An Outlier-Driven Approach to Compilation-Time Optimization

Authors Florian Huemer , David Leopoldseder , Aleksandar Prokopec , Raphael Mosaner , Hanspeter Mössenböck



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2024.20.pdf
  • Filesize: 1.33 MB
  • 28 pages

Document Identifiers

Author Details

Florian Huemer
  • Johannes Kepler University, Linz, Austria
David Leopoldseder
  • Oracle Labs, Vienna, Austria
Aleksandar Prokopec
  • Oracle Labs, Zurich, Switzerland
Raphael Mosaner
  • Oracle Labs, Linz, Austria
Hanspeter Mössenböck
  • Johannes Kepler University, Linz, Austria

Cite AsGet BibTex

Florian Huemer, David Leopoldseder, Aleksandar Prokopec, Raphael Mosaner, and Hanspeter Mössenböck. Taking a Closer Look: An Outlier-Driven Approach to Compilation-Time Optimization. In 38th European Conference on Object-Oriented Programming (ECOOP 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 313, pp. 20:1-20:28, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ECOOP.2024.20

Abstract

Improving compilation time in optimizing compilers is challenging due to their large number of interconnected components. This includes compiler optimizations, compiler tiers, heuristics, and profiling information. Despite this complexity, research in compilation-time optimization is often guided by analyzing metrics of entire program runs, such as the total compilation time and overall memory footprint. This coarse-grained perspective hides relevant information, such as source program functions for which the compiler allocates a lot of memory or compiler optimizations with a high impact on the total compilation time. This leaves high-level metrics as the only reference point for driving optimization design. Consequently, compilation-time regressions in one program function that are obscured by improvements in other functions stay undetected, while the impacts of compiler changes on untouched parts of the compiler are mainly unknown. Furthermore, developers overlook long-standing compiler defects because their high-level metrics do not change over time. To address these limitations, we propose ICON, a new data-driven approach to compilation-time optimization that breaks up high-level metrics into individual source program functions, compiler optimizations, or even into individual instructions in the compiler source code. Our methodology enables an iterative in-depth compilation-time analysis, focusing on outliers to identify optimization opportunities. We show that outliers, both in terms of time spent in a particular compiler optimization, and in terms of individual compilations that take substantially longer, can reveal potential problems in the compiler implementation. We applied our approach to GraalVM and extracted data for multiple of its language runtimes. We analyzed the resulting data, present the first detailed look into the distribution of compilation time in the GraalVM compiler, a state-of-the-art multi-language compiler, and identified defects that led to regressions in overall compilation time or the compilation time of specific languages. We furthermore designed two optimizations based on the identified outliers that improve compilation time between 2.25% and 9.45%. We believe that our approach can guide compiler developers in finding usually overlooked optimization potential and defects, and focus future research efforts in making compilers more efficient.

Subject Classification

ACM Subject Classification
  • General and reference → Performance
  • General and reference → Measurement
  • Software and its engineering → Just-in-time compilers
  • Software and its engineering → Dynamic compilers
Keywords
  • Compilation time
  • outliers
  • dynamic languages
  • virtual machines
  • GraalVM
  • ICON

Metrics

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

References

  1. Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley series in computer science / World student series edition. Addison-Wesley, 1986. URL: https://www.worldcat.org/oclc/12285707.
  2. Amir H. Ashouri, William Killian, John Cavazos, Gianluca Palermo, and Cristina Silvano. A survey on compiler autotuning using machine learning. ACM Comput. Surv., 51(5):96:1-96:42, September 2019. URL: https://doi.org/10.1145/3197978.
  3. Islem Bouzenia and Michael Pradel. Resource usage and optimization opportunities in workflows of github actions. In Proceedings of the 46th IEEE/ACM International Conference on Software Engineering, ICSE 2024, Lisbon, Portugal, April 14-20, 2024, pages 25:1-25:12, Los Alamitos, CA, USA, April 2024. ACM. URL: https://doi.org/10.1145/3597503.3623303.
  4. E. O. Brigham and R. E. Marrow. The fast fourier transform. IEEE Spectrum, 4(12):63-70, 1967. URL: https://doi.org/10.1109/MSPEC.1967.5217220.
  5. Michael D. Brown, Matthew Pruett, Robert Bigelow, Girish Mururu, and Santosh Pande. Not so fast: understanding and mitigating negative impacts of compiler optimizations on code reuse gadget sets. Proc. ACM Program. Lang., 5(OOPSLA):1-30, October 2021. URL: https://doi.org/10.1145/3485531.
  6. Timofey Bryksin, Victor Petukhov, Ilya Alexin, Stanislav Prikhodko, Alexey Shpilman, Vladimir Kovalenko, and Nikita Povarov. Using large-scale anomaly detection on code to improve kotlin compiler. In Sunghun Kim, Georgios Gousios, Sarah Nadi, and Joseph Hejderup, editors, MSR '20: 17th International Conference on Mining Software Repositories, Seoul, Republic of Korea, 29-30 June, 2020, MSR '20, pages 455-465, New York, NY, USA, 2020. ACM. URL: https://doi.org/10.1145/3379597.3387447.
  7. Cliff Click and Keith D. Cooper. Combining analyses, combining optimizations. ACM Trans. Program. Lang. Syst., 17(2):181-196, March 1995. URL: https://doi.org/10.1145/201059.201061.
  8. Cliff Click and Michael Paleczny. A simple graph-based intermediate representation. In Michael D. Ernst, editor, Proceedings ACM SIGPLAN Workshop on Intermediate Representations (IR'95), San Francisco, CA, USA, January 22, 1995, IR '95, pages 35-49, New York, NY, USA, 1995. ACM. URL: https://doi.org/10.1145/202529.202534.
  9. Charles Consel and Olivier Danvy. Tutorial notes on partial evaluation. In Mary S. Van Deusen and Bernard Lang, editors, Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Charleston, South Carolina, USA, January 1993, POPL '93, pages 493-501, New York, NY, USA, 1993. ACM Press. URL: https://doi.org/10.1145/158511.158707.
  10. Gilles Duboscq, Lukas Stadler, Thomas Würthinger, Doug Simon, Christian Wimmer, and Hanspeter Mössenböck. Graal ir: An extensible declarative intermediate representation. In Proceedings of the Asia-Pacific Programming Languages and Compilers Workshop, pages 1-9, 2013. Google Scholar
  11. Gilles Duboscq, Thomas Würthinger, Lukas Stadler, Christian Wimmer, Doug Simon, and Hanspeter Mössenböck. An intermediate representation for speculative optimizations in a dynamic compiler. In Christoph Bockisch, Michael Haupt, Steve Blackburn, Hridesh Rajan, and Joseph Gil, editors, VMIL@SPLASH '13: Proceedings of the 7th ACM workshop on Virtual machines and intermediate languages, Indianapolis, IN, USA, 28 October 2013, VMIL '13, pages 1-10, New York, NY, USA, 2013. ACM. URL: https://doi.org/10.1145/2542142.2542143.
  12. Gilles Marie Duboscq. Combining speculative optimizations with flexible scheduling of side-effects, 2016. URL: https://resolver.obvsg.at/urn:nbn:at:at-ubl:1-9708.
  13. Josef Eisl. Trace register allocation, 2018. URL: https://resolver.obvsg.at/urn:nbn:at:at-ubl:1-25787.
  14. Grigori Fursin, Yuriy Kashnikov, Abdul Wahid Memon, Zbigniew Chamski, Olivier Temam, Mircea Namolaru, Elad Yom-Tov, Bilha Mendelson, Ayal Zaks, Eric Courtois, François Bodin, Phil Barnard, Elton Ashton, Edwin V. Bonilla, John Thomson, Christopher K. I. Williams, and Michael F. P. O'Boyle. Milepost GCC: machine learning enabled self-tuning compiler. Int. J. Parallel Program., 39(3):296-327, June 2011. URL: https://doi.org/10.1007/s10766-010-0161-2.
  15. Yoshihiko Futamura. Partial evaluation of computation process - an approach to a compiler-compiler. High. Order Symb. Comput., 12(4):381-391, December 1999. URL: https://doi.org/10.1023/A:1010095604496.
  16. G. Genta G. Barbato, E. M. Barini and R. Levi. Features and performance of some outlier detection methods. Journal of Applied Statistics, 38(10):2133-2149, 2011. URL: https://doi.org/10.1080/02664763.2010.545119.
  17. James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley, Daniel Smith, and Gavin Bierman. The javaregistered language specification, 2024. URL: https://docs.oracle.com/javase/specs/jls/se22/jls22.pdf.
  18. Tobias Hartmann, Albert Noll, and Thomas R. Gross. Efficient code management for dynamic multi-tiered compilation systems. In Joanna Kolodziej and Bruce R. Childers, editors, 2014 International Conference on Principles and Practices of Programming on the Java Platform Virtual Machines, Languages and Tools, PPPJ '14, Cracow, Poland, September 23-26, 2014, PPPJ '14, pages 51-62, New York, NY, USA, 2014. ACM. URL: https://doi.org/10.1145/2647508.2647513.
  19. Urs Hölzle, Craig Chambers, and David M. Ungar. Debugging optimized code with dynamic deoptimization. In Stuart I. Feldman and Richard L. Wexelblat, editors, Proceedings of the ACM SIGPLAN'92 Conference on Programming Language Design and Implementation (PLDI), San Francisco, California, USA, June 17-19, 1992, volume 27, pages 32-43, New York, NY, USA, July 1992. ACM. URL: https://doi.org/10.1145/143095.143114.
  20. Kenneth Hoste and Lieven Eeckhout. Cole: compiler optimization level exploration. In Mary Lou Soffa and Evelyn Duesterwald, editors, Sixth International Symposium on Code Generation and Optimization (CGO 2008), April 5-9, 2008, Boston, MA, USA, CGO '08, pages 165-174, New York, NY, USA, 2008. ACM. URL: https://doi.org/10.1145/1356058.1356080.
  21. Christian Humer, Christian Wimmer, Christian Wirth, Andreas Wöß, and Thomas Würthinger. A domain-specific language for building self-optimizing AST interpreters. In Ulrik Pagh Schultz and Matthew Flatt, editors, Generative Programming: Concepts and Experiences, GPCE'14, Vasteras, Sweden, September 15-16, 2014, volume 50, pages 123-132, New York, NY, USA, September 2014. ACM. URL: https://doi.org/10.1145/2658761.2658776.
  22. Tarindu Jayatilaka, Hideto Ueno, Giorgis Georgakoudis, Eunjung Park, and Johannes Doerfert. Towards compile-time-reducing compiler optimization selection via machine learning. In Federico Silla and Osni Marques, editors, ICPP Workshops 2021: 50th International Conference on Parallel Processing, Virtual Event / Lemont (near Chicago), IL, USA, August 9-12, 2021, ICPP Workshops '21, pages 23:1-23:6, New York, NY, USA, 2021. ACM. URL: https://doi.org/10.1145/3458744.3473355.
  23. Thomas Kotzmann, Christian Wimmer, Hanspeter Mössenböck, Thomas Rodriguez, Kenneth B. 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. URL: https://doi.org/10.1145/1369396.1370017.
  24. Sameer Kulkarni and John Cavazos. Mitigating the compiler optimization phase-ordering problem using machine learning. In Gary T. Leavens and Matthew B. Dwyer, editors, Proceedings of the 27th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012, part of SPLASH 2012, Tucson, AZ, USA, October 21-25, 2012, OOPSLA '12, pages 147-162, New York, NY, USA, 2012. ACM. URL: https://doi.org/10.1145/2384616.2384628.
  25. Octave Larose, Sophie Kaleba, Humphrey Burchell, and Stefan Marr. AST vs. bytecode: Interpreters in the age of meta-compilation. Proc. ACM Program. Lang., 7(OOPSLA2):318-346, October 2023. URL: https://doi.org/10.1145/3622808.
  26. Tim Lindholm, Frank Yellin, Gilad Bracha, Alex Buckley, and Daniel Smith. The javaregistered virtual machine specification, 2024. URL: https://docs.oracle.com/javase/specs/jvms/se22/jvms22.pdf.
  27. Stefan Marr, Benoit Daloze, and Hanspeter Mössenböck. Cross-language compiler benchmarking: are we fast yet? In Roberto Ierusalimschy, editor, Proceedings of the 12th Symposium on Dynamic Languages, DLS 2016, Amsterdam, The Netherlands, November 1, 2016, volume 52, pages 120-131, New York, NY, USA, November 2016. ACM. URL: https://doi.org/10.1145/2989225.2989232.
  28. Uwe Meyer. Techniques for partial evaluation of imperative languages. In Charles Consel and Olivier Danvy, editors, Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM'91, Yale University, New Haven, Connecticut, USA, June 17-19, 1991, PEPM '91, pages 94-105, New York, NY, USA, 1991. ACM. URL: https://doi.org/10.1145/115865.115876.
  29. Steven S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997. Google Scholar
  30. Gennady Pekhimenko and Angela Demke Brown. Efficient program compilation through machine learning techniques. In Ken Naono, Keita Teranishi, John Cavazos, and Reiji Suda, editors, Software Automatic Tuning, From Concepts to State-of-the-Art Results, pages 335-351. Springer, New York, NY, 2010. URL: https://doi.org/10.1007/978-1-4419-6935-4_19.
  31. Bui Tuong Phong. Illumination for computer generated pictures. Commun. ACM, 18(6):311-317, June 1975. URL: https://doi.org/10.1145/360825.360839.
  32. Dmitry Plotnikov, Dmitry Melnik, Mamikon Vardanyan, Ruben Buchatskiy, Roman Zhuykov, and Je-Hyung Lee. Automatic tuning of compiler optimizations and analysis of their impact. In Vassil Alexandrov, Michael Lees, Valeria V. Krzhizhanovskaya, Jack J. Dongarra, and Peter M. A. Sloot, editors, Proceedings of the International Conference on Computational Science, ICCS 2013, Barcelona, Spain, 5-7 June, 2013, volume 18 of Procedia Computer Science, pages 1312-1321. Elsevier, 2013. 2013 International Conference on Computational Science. URL: https://doi.org/10.1016/j.procs.2013.05.298.
  33. Manuel Rigger, Matthias Grimmer, Christian Wimmer, Thomas Würthinger, and Hanspeter Mössenböck. Bringing low-level languages to the JVM: efficient execution of LLVM IR on truffle. In Antony L. Hosking and Witawas Srisa-an, editors, Proceedings of the 8th International Workshop on Virtual Machines and Intermediate Languages, VMIL@SPLASH 2016, Amsterdam, The Netherlands, October 31, 2016, VMIL 2016, pages 6-15, New York, NY, USA, 2016. ACM. URL: https://doi.org/10.1145/2998415.2998416.
  34. Rohan Basu Roy, Tirthak Patel, and Devesh Tiwari. Icebreaker: warming serverless functions better with heterogeneity. In Babak Falsafi, Michael Ferdman, Shan Lu, and Thomas F. Wenisch, editors, ASPLOS '22: 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Lausanne, Switzerland, 28 February 2022 - 4 March 2022, ASPLOS '22, pages 753-767, New York, NY, USA, 2022. ACM. URL: https://doi.org/10.1145/3503222.3507750.
  35. Doug Simon, Christian Wimmer, Bernhard Urban, Gilles Duboscq, Lukas Stadler, and Thomas Würthinger. Snippets: Taking the high road to a low level. ACM Trans. Archit. Code Optim., 12(2):20:20:1-20:20:25, June 2015. URL: https://doi.org/10.1145/2764907.
  36. Matija Sipek, Branko Mihaljevic, and Aleksander Radovan. Exploring aspects of polyglot high-performance virtual machine graalvm. In Marko Koricic, Zeljko Butkovic, Karolj Skala, Zeljka Car, Marina Cicin-Sain, Snjezana Babic, Vlado Sruk, Dejan Skvorc, Slobodan Ribaric, Stjepan Gros, Boris Vrdoljak, Mladen Mauher, Edvard Tijan, Predrag Pale, Darko Huljenic, Tihana Galinac Grbac, and Matej Janjic, editors, 42nd International Convention on Information and Communication Technology, Electronics and Microelectronics, MIPRO 2019, Opatija, Croatia, May 20-24, 2019, pages 1671-1676. IEEE, 2019. URL: https://doi.org/10.23919/MIPRO.2019.8756917.
  37. Matija Sipek, D. Muharemagic, Branko Mihaljevic, and Aleksander Radovan. Enhancing performance of cloud-based software applications with graalvm and quarkus. In Marko Koricic, Karolj Skala, Zeljka Car, Marina Cicin-Sain, Vlado Sruk, Dejan Skvorc, Slobodan Ribaric, Bojan Jerbic, Stjepan Gros, Boris Vrdoljak, Mladen Mauher, Edvard Tijan, Tihomir Katulic, Predrag Pale, Tihana Galinac Grbac, Nikola Filip Fijan, Adrian Boukalov, Dragan Cisic, and Vera Gradisnik, editors, 43rd International Convention on Information, Communication and Electronic Technology, MIPRO 2020, Opatija, Croatia, September 28 - October 2, 2020, pages 1746-1751. IEEE, 2020. URL: https://doi.org/10.23919/MIPRO48935.2020.9245290.
  38. Lukas Stadler, Thomas Würthinger, and Hanspeter Mössenböck. Partial escape analysis and scalar replacement for java. In David R. Kaeli and Tipp Moseley, editors, 12th Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2014, Orlando, FL, USA, February 15-19, 2014, CGO '14, page 165, New York, NY, USA, 2014. ACM. URL: https://doi.org/10.1145/2581122.2544157.
  39. James Stanier and Des Watson. Intermediate representations in imperative compilers: A survey. ACM Comput. Surv., 45(3):26:1-26:27, July 2013. URL: https://doi.org/10.1145/2480741.2480743.
  40. Mark N. Wegman and F. Kenneth Zadeck. Constant propagation with conditional branches. ACM Trans. Program. Lang. Syst., 13(2):181-210, April 1991. URL: https://doi.org/10.1145/103135.103136.
  41. Christian Wimmer. Linear scan register allocation for the java hotspottrademark client compiler, 2004. Google Scholar
  42. Christian Wimmer, Codrut Stancu, Peter Hofer, Vojin Jovanovic, Paul Wögerer, Peter B. Kessler, Oleg Pliss, and Thomas Würthinger. Initialize once, start fast: application initialization at build time. Proc. ACM Program. Lang., 3(OOPSLA):184:1-184:29, October 2019. URL: https://doi.org/10.1145/3360610.
  43. W. Eric Wong, Joseph R. Horgan, Saul London, and Hiralal Agrawal. A study of effective regression testing in practice. In Eighth International Symposium on Software Reliability Engineering, ISSRE 1997, Albuquerque, NM, USA, November 2-5, 1997, pages 264-274. IEEE Computer Society, November 1997. URL: https://doi.org/10.1109/ISSRE.1997.630875.
  44. Thomas Würthinger, Christian Wimmer, Christian Humer, Andreas Wöß, Lukas Stadler, Chris Seaton, Gilles Duboscq, Doug Simon, and Matthias Grimmer. Practical partial evaluation for high-performance dynamic language runtimes. In Albert Cohen and Martin T. Vechev, editors, Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, June 18-23, 2017, PLDI 2017, pages 662-676, New York, NY, USA, 2017. ACM. URL: https://doi.org/10.1145/3062341.3062381.
  45. 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 Antony L. Hosking, Patrick Th. Eugster, and Robert Hirschfeld, editors, ACM Symposium on New Ideas in Programming and Reflections on Software, Onward! 2013, part of SPLASH '13, Indianapolis, IN, USA, October 26-31, 2013, Onward! 2013, pages 187-204, New York, NY, USA, 2013. ACM. URL: https://doi.org/10.1145/2509578.2509581.
  46. Yifei Zhang, Tianxiao Gu, Xiaolin Zheng, Lei Yu, Wei Kuai, and Sanhong Li. Towards a serverless java runtime. In 36th IEEE/ACM International Conference on Automated Software Engineering, ASE 2021, Melbourne, Australia, November 15-19, 2021, pages 1156-1160. IEEE, 2021. URL: https://doi.org/10.1109/ASE51524.2021.9678709.
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