Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3623507.3623554acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article
Open access

Hybrid Execution: Combining Ahead-of-Time and Just-in-Time Compilation

Published: 19 October 2023 Publication History

Abstract

Ahead-of-time (AOT) compilation is a well-known approach to statically compile programs to native code before they are executed. In contrast, just-in-time (JIT) compilation typically starts with executing a slower, less optimized version of the code and compiles frequently executed methods at run time. In doing so, information from static and dynamic analysis is utilized to speculate and help generate highly efficient code. However, generating such an efficient JIT-compiled code is challenging, and this introduces a trade-off between warm-up performance and peak performance.
In this paper, we present a novel way to execute programs by bringing together the divergence that existed between AOT and JIT compilation. Instead of having the JIT compiler analyze the program during interpretation to produce optimal code, critical functions are initially executed natively with code produced by the AOT compiler in order to gain a head start. Thus, we avoid the overhead of JIT compilation for natively executed methods and increase the warm-up performance. We implemented our approach in GraalVM, which is a multi-language virtual machine based on the Java HotSpot VM. Improvements in warm-up performance show a speed-up of up to 1.7x.

References

[1]
2023. clang: C++ compiler. https://www.clang.org/
[2]
2023. GraalVM. https://www.graalvm.org/
[3]
2023. High-performance Modern Python – run your applications with GraalPy. https://www.graalvm.org/python/
[4]
2023. HPy: a better API for Python. https://docs.hpyproject.org/en/latest/
[5]
2023. PYPL PopularitY of Programming Language index. https://pypl.github.io/PYPL.html
[6]
2023. PyPy – A fast, compliant alternative implementation of Python. https://www.pypy.org/
[7]
2023. Truffle Native Function Interface – Oracle GraalVM for JDK 17. https://docs.oracle.com/en/graalvm/jdk/17/docs/graalvm-as-a-platform/language-implementation-framework/NFI/##truffle-native-function-interface
[8]
John Aycock. 2003. A Brief History of Just-in-Time. ACM Comput. Surv., 35, 2 (2003), jun, 97–113. issn:0360-0300 https://doi.org/10.1145/857076.857077
[9]
Edd Barrett, Carl Friedrich Bolz-Tereick, Rebecca Killick, Sarah Mount, and Laurence Tratt. 2017. Virtual Machine Warmup Blows Hot and Cold. Proc. ACM Program. Lang., 1, OOPSLA (2017), Article 52, oct, 27 pages. https://doi.org/10.1145/3133876
[10]
Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski, and Armin Rigo. 2009. Tracing the Meta-Level: PyPy’s Tracing JIT Compiler. In Proceedings of the 4th Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems (ICOOOLPS ’09). Association for Computing Machinery, New York, NY, USA. 18–25. isbn:9781605585413 https://doi.org/10.1145/1565824.1565827
[11]
Maxime Chevalier-Boisvert, Noah Gibbs, Jean Boussier, Si Xing (Alan) Wu, Aaron Patterson, Kevin Newton, and John Hawthorn. 2021. YJIT: A Basic Block Versioning JIT Compiler for CRuby. In Proceedings of the 13th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages (VMIL 2021). Association for Computing Machinery, New York, NY, USA. 25–32. isbn:9781450391092 https://doi.org/10.1145/3486606.3486781
[12]
Ron Cytron, Jeanne Ferrante, Barry K Rosen, Mark N Wegman, and F Kenneth Zadeck. 1989. An efficient method of computing static single assignment form. In Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. 25–35.
[13]
David Flanagan. 2006. JavaScript: the definitive guide. " O’Reilly Media, Inc.".
[14]
Olivier Flückiger, Jan Ječmen, Sebastián Krynski, and Jan Vitek. 2022. Deoptless: speculation with dispatched on-stack replacement and specialized continuations. In Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation. ACM. https://doi.org/10.1145/3519939.3523729
[15]
C. Lattner and V. Adve. 2004. LLVM: a compilation framework for lifelong program analysis and transformation. In International Symposium on Code Generation and Optimization, 2004. CGO 2004. 75–86. https://doi.org/10.1109/CGO.2004.1281665
[16]
LXML. 2023. lxml/lxml – The lxml XML toolkit for Python. https://github.com/lxml/lxml
[17]
Ross McIlroy. 2016. Firing up the ignition interpreter. https://v8.dev/blog/ignition-interpreter
[18]
Oracle. 2023. Graal/Sulong at master · Oracle/Graal. https://github.com/oracle/graal/tree/master/sulong
[19]
T. Pittman. 1987. Two-Level Hybrid Interpreter/Native Code Execution for Combined Space-Time Program Efficiency. In Papers of the Symposium on Interpreters and Interpretive Techniques (SIGPLAN ’87). Association for Computing Machinery, New York, NY, USA. 150–152. isbn:0897912357 https://doi.org/10.1145/29650.29666
[20]
Manuel Rigger, Matthias Grimmer, Christian Wimmer, Thomas Würthinger, and Hanspeter Mössenböck. 2016. Bringing Low-Level Languages to the JVM: Efficient Execution of LLVM IR on Truffle. In Proceedings of the 8th International Workshop on Virtual Machines and Intermediate Languages (VMIL 2016). Association for Computing Machinery, New York, NY, USA. 6–15. isbn:9781450346450 https://doi.org/10.1145/2998415.2998416
[21]
Leszek Swirski. 2021. Sparkplug – a non-optimizing JavaScript compiler. https://v8.dev/blog/sparkplug
[22]
Laurence Tratt. 2009. Dynamically typed languages. Advances in Computers, 77 (2009), 149–184.
[23]
Lionel Sujay Vailshery. 2022. Most used languages among software developers globally 2022. https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/
[24]
Guido Van Rossum and Fred L. Drake. 2009. Python 3 Reference Manual. CreateSpace, Scotts Valley, CA. isbn:1441412697
[25]
Christian Wimmer and Thomas Würthinger. 2012. Truffle: a self-optimizing runtime system. In Proceedings of the 3rd annual conference on Systems, programming, and applications: software for humanity. 13–14.
[26]
Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Georg Richards, Doug Simon, and Mario Wolczko. 2013. One VM to rule them all. In Proceedings of the 2013 ACM international symposium on New ideas, new paradigms, and reflections on programming and software. ACM, New York, NY, USA. 187–204. https://doi.org/10.1145/2509578.2509581

Cited By

View all
  • (2024)Compilation of Modular and General Sparse WorkspacesProceedings of the ACM on Programming Languages10.1145/36564268:PLDI(1213-1238)Online publication date: 20-Jun-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
VMIL 2023: Proceedings of the 15th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages
October 2023
99 pages
ISBN:9798400704017
DOI:10.1145/3623507
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 October 2023

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. ahead-of-time
  2. just-in-time
  3. performance
  4. virtual machine

Qualifiers

  • Research-article

Conference

VMIL '23
Sponsor:

Acceptance Rates

Overall Acceptance Rate 4 of 4 submissions, 100%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)378
  • Downloads (Last 6 weeks)46
Reflects downloads up to 12 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Compilation of Modular and General Sparse WorkspacesProceedings of the ACM on Programming Languages10.1145/36564268:PLDI(1213-1238)Online publication date: 20-Jun-2024

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media