Code Optimization Bypassing Data Conversion Overhead

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In programming languages like Scala and Java, data representation of variables or objects in user programs differs from the data representation in memory regions managed by platforms or frameworks, leading to performance bottlenecks due to data conversion requirements.

Innovation Solution

A method that identifies code portions accessing primitive values in user-defined functions, converts them to directly reference the internal data representation of the user program, and generates calling code to execute the converted functions, thereby bypassing unnecessary data conversion.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If data conversion is performed between user program data representation and framework-managed memory data representation, then compatibility between user programs and framework is ensured, but execution speed deteriorates due to conversion overhead

Engineering Contradiction:
ImprovecompatibilityVSAvoidexecution speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

The patent extracts and eliminates the data conversion step from the execution path by allowing user programs to directly reference framework-managed memory through generated code that bypasses conventional data representation boundaries. This removes the conversion overhead while maintaining compatibility through controlled code generation.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces a code generation intermediary that translates user program references into direct memory access operations. This intermediary (the code generation system) mediates between user program data representations and framework-managed memory, creating optimized calling code that eliminates runtime conversion while preserving type safety and compatibility.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Speed

If direct reference to internal data representation is implemented, then execution speed is improved by eliminating data conversion, but code complexity increases due to conversion logic

Engineering Contradiction:
Improveexecution speedVSAvoidcode complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent performs code generation in advance during compilation or code preparation phases. The complex logic for creating direct memory references is executed beforehand, producing optimized calling code that appears simple at runtime. This preliminary action shifts complexity from runtime to build time.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates copied and adapted versions of user program code through the code generation process. Instead of modifying original user code directly, it generates new calling code that incorporates direct memory references, preserving the original code's simplicity while achieving performance improvements in the generated version.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11029924B2Program optimization by converting code portions to directly reference internal data representations
Publication Date: 2021.06.08 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11029924B2 patent drawing
  • US11029924B2 patent drawing
  • US11029924B2 patent drawing

AI summary

A method includes identifying a code portion that accesses a primitive value in a user-defined function included in a user program, converting the code portion and an argument in a manner to directly reference an internal data representation of the user program, and generating a code for calling the user-defined function converted by the conversion.