Java Object Header Injection for Data Conversion Overhead
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Data conversions between Java and non-Java representations, such as those in Apache Spark, are slow and act as performance bottlenecks due to the overhead involved in converting between these formats.
Innovation Solution
The solution involves adding an object header to the first object and returning its address as a pointer to a user-defined function, ensuring the target object does not escape or have pointers to other objects, and managing metadata within the managed runtime to optimize the conversion process.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If data conversion between Java and non-Java representations is performed using traditional methods, then the conversion is complete and functional, but the conversion speed is slow and acts as a performance bottleneck
Solution Approach 1:
The patent creates a copy of the non-Java object in Java representation by allocating a new Java object and copying data from the non-Java object to this new Java object. This copying approach allows the system to maintain both representations simultaneously, enabling fast conversion by directly copying memory contents rather than performing complex transformation operations, thereby improving conversion speed while reducing time loss.
2Reliability
If an object header is added to the first object to create the second object, then the Java representation is properly formed, but the memory overhead increases
Solution Approach 1:
The patent embeds the non-Java object data within the Java object structure by placing the byte array containing non-Java representation data as a field within the newly created Java object. This nesting approach allows the system to maintain proper Java object format with required headers while efficiently reusing the existing non-Java data buffer, thereby reducing overall memory overhead compared to creating completely separate storage structures.
3Device complexity
If the first object lacks pointers to other objects and does not escape, then garbage collection is simplified, but the object's functionality is limited
Solution Approach 1:
The patent extracts the problematic pointers and references from the object graph by creating a new Java object that contains only the essential data from the non-Java object, excluding complex pointer relationships. This extraction approach simplifies the object structure for garbage collection purposes while maintaining the core functionality needed for data processing, thereby reducing garbage collection complexity without significantly limiting adaptability.
Data Source
AI summary
A computer-implemented method and a computer program product are provided for converting a first object having a first data format to a second object having a second data format that is different from the first format in that the second data format requires an object header. The method includes adding the object header to the first object. The method further includes returning, as a pointer, an address of the added object header to a user defined function that uses the second object. The first object lacks pointers to other objects, and does not escape.


