Delegating JIT Bytecode Compilation to Serverless WASM Runtime

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Java applications running on a computer experience significant CPU cycle loss due to the operation of Just-in-Time (JIT) compilation environments, which consume valuable processing resources through repeated operations, especially for frequently accessed methods.

Innovation Solution

Delegating Just-In-Time (JIT) bytecode compilation to a serverless Web Assembly (WASM) runtime, where the WASM runtime receives bytecode and additional arguments, compiles it, and sends back assembly instructions for execution, conserving CPU cycles by only compiling frequently accessed methods.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If JIT compilation is performed on the host, then code execution speed is improved, but CPU cycle consumption increases significantly

Engineering Contradiction:
Improvecode execution speedVSAvoidCPU cycle consumption
Core Design Contradiction:
SpeedVSUse of energy by moving object

Solution Approach 1:

The patent extracts the JIT compilation function from the host JVM and relocates it to a serverless WASM runtime environment. The host delegates bytecode compilation requests to the external WASM runtime, which performs the compilation work and returns the compiled code. This extraction removes the computationally intensive compilation process from the host system while preserving the performance benefits of compiled code execution.

Inventive Principle:
Principle #2Taking out (Extraction)

2Productivity

If bytecode is compiled for frequently accessed methods, then execution efficiency is improved, but compilation time increases

Engineering Contradiction:
Improveexecution efficiencyVSAvoidcompilation time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent implements speculative loading of WASM modules based on historical compilation activities. The system proactively loads and prepares compilation resources before they are actually needed, using patterns from historical data to predict future compilation requirements. This preliminary action reduces the actual compilation time when methods are accessed by having resources ready in advance.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If JIT compilation is performed repeatedly for high demand methods, then code optimization is improved, but processing resources are consumed

Engineering Contradiction:
Improvecode optimizationVSAvoidprocessing resources
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent implements a caching mechanism where compiled code and WASM modules are stored and reused. When the same bytecode or compilation result is needed again, the system retrieves the cached copy instead of performing compilation again. This copying approach maintains code optimization quality while eliminating redundant compilation operations that consume processing resources.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11392357B2Delegating bytecode runtime compilation to serverless environment
Publication Date: 2022.07.19 SAP SE
  • US11392357B2 patent drawing
  • US11392357B2 patent drawing
  • US11392357B2 patent drawing

AI summary

A host delegates Just-In-Time (JIT) bytecode compilation to a serverless Web Assembly (WASM) runtime. The WASM runtime receives the bytecode, together with any additional arguments (e.g.: offsets of dependent functions, vtable metadata, virtual machine state). The host may include a parser to provide the additional arguments. In response to receiving the bytecode and arguments, the WASM runtime triggers a thread and loads appropriate WASM modules to compile the bytecode. The resulting assembly instructions are sent back to the host for execution in connection with the (frequently requested) method. Only the bytecode of frequently-accessed methods (as determined at the host) may be delegated for compilation. Delegation of bytecodes for compilation according to embodiments, may conserve a significant percentage of CPU cycles at the host, which can then be used for executing code instead. Based upon analysis of historical compilation activities, particular embodiments may pro-actively implement speculative loading of additional WASM modules.