An Analysis of Compiled Code Reusability in Dynamic Compilation
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 within a high-performance VM. We present an empirical study using the GraalVM compiler and the HotSpot Java VM. To facilitate code reuse, we introduce an approach that compiles code into a reusable high-level intermediate representation (IR). This approach defers VM-specific optimizations until the time of reuse. The incurred slowdown of such code varies by workload, ranging between a negligible impact and a 6x slowdown. Although deferred optimization impacts the efficiency of particular code patterns, such reused code still performs significantly better than that compiled by a lower-tier compiler. Therefore, the presented approach can form the foundation for improving warmup times in certain workloads.
Sun 20 OctDisplayed time zone: Pacific Time (US & Canada) change
09:00 - 10:30 | |||
09:00 10mDay opening | Opening Remarks VMIL | ||
09:15 30mResearch paper | Accelerate RISC-V Instruction Set Simulation by Tiered JIT Compilation VMIL Yen-Fu Chen National Cheng Kung University, Meng-Hung Chen National Cheng Kung University, Ching-Chun Huang National Cheng Kung University, Chia-Heng Tu National Cheng Kung University DOI File Attached | ||
09:45 30mResearch paper | An Analysis of Compiled Code Reusability in Dynamic Compilation VMIL Andrej Pečimúth Oracle Labs; Charles University, David Leopoldseder Oracle Labs, Petr Tuma Charles University DOI Pre-print | ||
10:15 15mExperience report | Inlined Code Generation for Smalltalk VMIL Dave Mason Toronto Metropolitan University (formerly Ryerson University), Daniel Franklin Toronto Metropolitan University File Attached |