Compiler Function Segmentation for JIT Compile Time Reduction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The compilation time of computer programs can be significantly increased by large-sized programming functions, leading to non-linear dependencies and prolonged execution delays, particularly in dynamic in-memory database environments using Just-In-Time compilers.
Innovation Solution
A method involving the construction of an Abstract Syntax Tree (AST) representation of the source program, identification of candidate splitting regions, and extraction of these regions to form smaller target functions, which are then transformed and used to generate machine-executable target programs, thereby reducing compile time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If large-sized programming functions are used in source code, then functionality and complexity are improved, but compile time increases non-linearly
Solution Approach 1:
The patent applies segmentation by dividing large programming functions into smaller sub-functions based on Abstract Syntax Tree (AST) analysis. The compiler identifies candidate splitting regions within functions and extracts them as separate target functions, transforming the original function into multiple smaller units that can be compiled more efficiently while preserving the original functionality through function calls.
2Adaptability or versatility
If source code is compiled dynamically during runtime (JIT compilation), then machine independence is improved, but execution speed deteriorates due to compile time delays
Solution Approach 1:
The patent applies preliminary action by performing function splitting transformations on the AST before code generation. By identifying and extracting candidate splitting regions in advance, the compiler prepares optimized function structures that reduce compilation time during runtime JIT compilation, thereby improving execution speed while maintaining machine independence.
3Productivity
If automatic source code generators are used, then productivity is improved, but function size increases leading to longer compile times
Solution Approach 1:
The patent applies segmentation by automatically dividing generator-produced functions into smaller sub-functions using AST analysis. This post-generation segmentation reduces the size of individual functions that need to be compiled, thereby reducing compile time while preserving the productivity benefits of automatic code generation.
Data Source
AI summary
A method for reducing a compile time of a source program includes receiving, by a compiler hosted on a computer, the source program. The compiler may have a compile time that depends non-linearly on a size of a function in the source program. The method involves identifying a source function in the source program and splitting the source function in to two or more target functions having sizes smaller than a size of the source function. The method further includes compiling the source program with the two or more target functions having sizes smaller than a size of the source function replacing the source function in the source program.


