Proceedings paper

Title:
An Analysis of Compiled Code Reusability in Dynamic Compilation
Authors:
A. Pečimúth, D. Leopoldseder, P. Tůma
Publication:
Proceedings of the 16th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages (VMIL '24)
DOI:
Year:
2024
ISBN:
979-8-4007-1213-5/24/10
Fulltext:
Link:

Abstract:
Large applications reliant on dynamic compilation for performance often run in horizontally scaled architectures. When this is combined with frequent deployment or demand-based scaling, hardware capacity is lost to frequent warmup phases due to the need to recompile the code after each start of the virtual machine (VM). Moreover, the individual VMs waste hardware resources by repeating the same compilations. Offloading compilation jobs to a dedicated compilation server can mitigate these problems. Such a server can compile the code in a mode where the compilation result is reusable for multiple VMs. The goal is to save compilation resources, such as CPU and memory, and potentially improve the warmup time of individual VMs. This paper investigates the options to reuse previous compilation results of a high-performance compiler. Rather than reusing machine code, we propose to reuse a pre-optimized intermediate representation (IR). Reusability is achieved by deferring VM-specific optimizations until the IR is compiled to machine code for a concrete VM. In an empirical study using the GraalVM compiler and the HotSpot Java VM, the slowdown of code compiled with deferred optimization ranges between a negligible impact and a 6x slowdown. However, the code still performs significantly better than the code compiled by a lower-tier compiler. Therefore, the presented approach can form the foundation for improving warmup times in certain workloads.

BibTeX:
@inproceedings{pecimuth_analysis_2024,
    title = {{An Analysis of Compiled Code Reusability in Dynamic Compilation}},
    author = {Pečimúth, Andrej and Leopoldseder, David and Tůma, Petr},
    year = {2024},
    booktitle = {{Proceedings of the 16th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages (VMIL '24)}},
    publisher = {ACM},
    location = {Pasadena, CA, USA},
    doi = {10.1145/3689490.3690406},
    isbn = {979-8-4007-1213-5/24/10},
    url = {https://doi.org/10.1145/3689490.3690406},
}