Selective Compilation for Virtual Machine Execution Performance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Dynamic compilers used in virtual machine environments face performance limitations due to time-consuming hot spot detection and limited optimization, leading to suboptimal execution performance, especially in environments like Android where intermediate code is prevalent.
Innovation Solution
A method of selective compilation that generates a software application with two parts: one executed by the virtual machine and another directly executable on the hardware platform, allowing developers to choose which code segments to compile into binary form for improved performance without relying on dynamic compilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If dynamic compilation is used to optimize intermediate code execution, then execution performance is improved, but compilation time and system complexity increase
Solution Approach 1:
The patent applies preliminary action by performing selective compilation of hot spots before runtime execution. The compilation process identifies performance-critical code segments and compiles them to binary code in advance, so that during runtime only the uncompiled portions need to be executed by the virtual machine. This eliminates the need for time-consuming dynamic compilation during execution while still achieving performance optimization.
Solution Approach 2:
The patent segments the application code into two distinct parts: compiled binary code for performance-critical sections and uncompiled intermediate code for other sections. This segmentation allows the system to apply different execution strategies to different parts of the application, running compiled code directly on the hardware platform for speed while maintaining virtual machine execution for the remainder, thus balancing performance and compilation overhead.
2Speed
If dynamic compilation is used to optimize intermediate code execution, then execution performance is improved, but the system becomes more complex
Solution Approach 1:
The patent extracts the compilation functionality from the runtime virtual machine environment and places it in a separate pre-compilation phase. By taking out the compilation process from the execution path, the system avoids the complexity of integrating dynamic compilation mechanisms into the virtual machine while still achieving performance benefits through selective compilation of hot spots before deployment.
3Speed
If complete compilation of intermediate code is performed, then execution performance is maximized, but memory usage and compilation overhead increase
Solution Approach 1:
The patent applies partial action by selectively compiling only the most performance-critical portions of the application (hot spots) rather than the entire codebase. This selective approach compiles approximately 20% of the code to binary format, providing significant performance improvement while avoiding the memory overhead and compilation time associated with complete compilation of all intermediate code.
Data Source
AI summary
A method and compiling device are provided for compiling a software application to be executed on a virtual machine of a physical platform. The software application originally is in the form of a set of codes to be compiled. The method includes a phase of selectively compiling the set of codes to be compiled, outputting a compiled application including a first application part which is executed by the virtual machine using commands from the virtual machine, and a second application part including binary commands which can be executed directly on the physical platform.


