[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/3679007.3685055acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

The Cost of Profiling in the HotSpot Virtual Machine

Published: 13 September 2024 Publication History

Abstract

Modern language runtimes use just-in-time compilation to execute applications natively. Typically, multiple compiler tiers cooperate so that compilation at a later stage can leverage profiling information generated by earlier tiers. This allows for machine code that is optimized to the actual workload and hardware. In this work, we study the profiling overhead caused by code instrumentation in the HotSpot Java virtual machine for 23 applications from the Renaissance suite and five additional benchmarks. Our study confirms two common assumptions. First, most applications move quickly through the profiling phase. However, we also show applications that tier up surprisingly slowly and, thus, are more affected by profiling overheads. We find that the instrumentation needed for profiling can slow application execution down by up to 35×. A key factor is the memory contention on the shared profiling data structures in multi-threaded applications. Second, most virtual call sites are monomorphic, i.e., they only have a single receiver type. This can reduce the run-time cost of otherwise expensive receiver type profiling at virtual call sites. Our analysis suggests that, for the most part, profiling overhead in language runtimes is not a cause for concern. However, we show that there are situations, e.g., in multi-threaded applications, where profiling impact can be consequential.

References

[1]
Matthew Arnold, Adam Welc, and V. T. Rajan. 2005. Improving Virtual Machine Performance Using a Cross-Run Profile Repository. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’05). Association for Computing Machinery, New York, NY, USA. 297–311. isbn:1595930310 https://doi.org/10.1145/1094811.1094835
[2]
2022. Improving startup performance with Lambda SnapStart. https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html
[3]
2023. Azul Platform Prime ReadyNow: Solving the Java Warmup Problem. https://www.azul.com/wp-content/uploads/Prime-Data-Sheet-ReadyNow-Orchestrator.pdf
[4]
Joao Carreira, Sumer Kohli, Rodrigo Bruno, and Pedro Fonseca. 2021. From Warm to Hot Starts: Leveraging Runtimes for the Serverless Era. In Proceedings of the Workshop on Hot Topics in Operating Systems (HotOS ’21). Association for Computing Machinery, New York, NY, USA. 58–64. isbn:9781450384384 https://doi.org/10.1145/3458336.3465305
[5]
Dehao Chen, David Xinliang Li, and Tipp Moseley. 2016. AutoFDO: Automatic Feedback-Directed Optimization for Warehouse-Scale Applications. In Proceedings of the 2016 International Symposium on Code Generation and Optimization (CGO’16). Association for Computing Machinery, New York, NY, USA. 12–23. isbn:9781450337786 https://doi.org/10.1145/2854038.2854044
[6]
L. Peter Deutsch and Allan M. Schiffman. 1984. Efficient Implementation of the Smalltalk-80 System. In Proceedings of the 11th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL ’84). 297–302. isbn:0897911253 https://doi.org/10.1145/800017.800542
[7]
Gem Dot, Alejandro Martínez, and Antonio González. 2017. Removing checks in dynamically typed languages through efficient profiling. In 2017 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). 257–268. https://doi.org/10.1109/CGO.2017.7863745
[8]
Oliver Flückiger, Jan Ječmen, Sebastián Krynski, and Jan Vitek. 2022. Deoptless: Speculation with Dispatched on-Stack Replacement and Specialized Continuations. In Proc. of PLDI’22 (PLDI 2022). 749–761. https://doi.org/10.1145/3519939.3523729
[9]
Graham Hamilton, Gilad Bracha, and Danny Coward. 2011. JSR 292: Supporting Dynamically Typed Languages on the Java Platform.
[10]
Alexey Khrabrov, Marius Pirvu, Vijay Sundaresan, and Eyal de Lara. 2022. JITServer: Disaggregated Caching JIT Compiler for the JVM in the Cloud. In 2022 USENIX Annual Technical Conference (USENIX ATC 22). USENIX Association, Carlsbad, CA. 869–884. isbn:978-1-939133-29-62 https://www.usenix.org/conference/atc22/presentation/khrabrov
[11]
Sumer Kohli, Shreyas Kharbanda, Rodrigo Bruno, Joao Carreira, and Pedro Fonseca. 2024. Pronghorn: Effective Checkpoint Orchestration for Serverless Hot-Starts. In Proceedings of the 19th European Conference on Computer Systems (EuroSys ’24). Association for Computing Machinery, New York, NY, USA. 298–316. isbn:9798400704376 https://doi.org/10.1145/3627703.3629556
[12]
Kyungwoo Lee, Ellis Hoag, and Nikolai Tillmann. 2022. Efficient Profile-Guided Size Optimization for Native Mobile Applications. In Proceedings of the 31st ACM SIGPLAN International Conference on Compiler Construction (CC 2022). Association for Computing Machinery, New York, NY, USA. 243–253. isbn:9781450391832 https://doi.org/10.1145/3497776.3517764
[13]
Zoltan Majo, Tobias Hartmann, Marcel Mohler, and Thomas R. Gross. 2017. Integrating Profile Caching into the HotSpot Multi-Tier Compilation System. In Proceedings of the 14th International Conference on Managed Languages and Runtimes (ManLang 2017). Association for Computing Machinery, New York, NY, USA. 105–118. isbn:9781450353403 https://doi.org/10.1145/3132190.3132210
[14]
Angela Nicoara, Gustavo Alonso, and Timothy Roscoe. 2008. Controlled, Systematic, and Efficient Code Replacement for Running Java Programs. In Proc. of the 3rd ACM SIGOPS/EuroSys European Conference on Computer Systems 2008 (Eurosys ’08). 233–246. isbn:9781605580135 https://doi.org/10.1145/1352592.1352617
[15]
Guilherme Ottoni and Bin Liu. 2021. HHVM Jump-Start: Boosting Both Warmup and Steady-State Performance at Scale. In Proceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO ’21). IEEE Press, 340–350. isbn:9781728186139 https://doi.org/10.1109/CGO51591.2021.9370314
[16]
Maksim Panchenko, Rafael Auler, Bill Nell, and Guilherme Ottoni. 2019. BOLT: A Practical Binary Optimizer for Data Centers and Beyond. In Proceedings of the 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO’19). IEEE Press, 2–14. isbn:9781728114361
[17]
Maksim Panchenko, Rafael Auler, Laith Sakka, and Guilherme Ottoni. 2021. Lightning BOLT: Powerful, Fast, and Scalable Binary Optimization. In Proceedings of the 30th ACM SIGPLAN International Conference on Compiler Construction (CC 2021). Association for Computing Machinery, New York, NY, USA. 119–130. isbn:9781450383257 https://doi.org/10.1145/3446804.3446843
[18]
Alberto Parravicini and Rene Mueller. 2021. The Cost of Speculation: Revisiting Overheads in the V8 JavaScript Engine. In 2021 IEEE International Symposium on Workload Characterization (IISWC). 13–23. https://doi.org/10.1109/IISWC53511.2021.00013
[19]
Aleksandar Prokopec, Andrea Rosà, David Leopoldseder, Gilles Duboscq, Petr Tůma, Martin Studener, Lubomír Bulej, Yudi Zheng, Alex Villazón, Doug Simon, Thomas Würthinger, and Walter Binder. 2019. Renaissance: Benchmarking Suite for Parallel Applications on the JVM. In Proc of PLDI. 31–47. isbn:9781450367127 https://doi.org/10.1145/3314221.3314637
[20]
Simon Ritter. 2022. Java on CRaC: Superfast JVM Application Startup. In Devoxx Conference Belgium.
[21]
John Rose. 2012. JEP 160: Lambda-Form Representation for Method Handles.
[22]
Han Shen, Krzysztof Pszeniczny, Rahman Lavaee, Snehasish Kumar, Sriraman Tallam, and Xinliang David Li. 2023. Propeller: A Profile Guided, Relinking Optimizer for Warehouse-Scale Applications. In Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2 (ASPLOS 2023). Association for Computing Machinery, New York, NY, USA. 617–631. isbn:9781450399166 https://doi.org/10.1145/3575693.3575727
[23]
April W. Wade, Prasad A. Kulkarni, and Michael R. Jantz. 2017. AOT vs. JIT: Impact of Profile Data on Code Quality. In Proceedings of the 18th ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES 2017). Association for Computing Machinery, New York, NY, USA. 1–10. isbn:9781450350303 https://doi.org/10.1145/3078633.3081037
[24]
Ahmad Yasin. 2014. A Top-Down method for performance analysis and counters architecture. In 2014 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS) (ISPASS 2014). 35–44.
[25]
2020. Airline Reporting Carrier On-Time Performance Dataset. https://dax-cdn.cdn.appdomain.cloud/dax-airline/1.0.1/airline.tar.gz Last accessed June 2023

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
MPLR 2024: Proceedings of the 21st ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes
September 2024
126 pages
ISBN:9798400711183
DOI:10.1145/3679007
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 September 2024

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. JIT compiler
  2. Java virtual machine
  3. profiling

Qualifiers

  • Research-article

Conference

MPLR '24
Sponsor:

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 80
    Total Downloads
  • Downloads (Last 12 months)80
  • Downloads (Last 6 weeks)11
Reflects downloads up to 04 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media