Accurate Execution Time Profiling for Interpreted Functions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional profiling techniques fail to accurately report execution time and resource usage for computer programs that include interpreted functions, as they incorrectly attribute these metrics to the interpretive function rather than the functions being interpreted, especially in mixed-language programming environments.
Innovation Solution
The solution involves using sampled or instrumented profiling techniques to examine the program execution stack, identifying when an interpretive function is executed, and associating the execution time and resource usage with the interpreted functions instead of the interpretive functions, thereby providing accurate profiling metrics.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If conventional profiling techniques are used to measure execution time of interpretive functions, then the profiling process is simple and fast, but the measurement precision is inaccurate because execution time is incorrectly attributed to the interpretive function rather than the interpreted function
Solution Approach 1:
The profiling system segments the measurement process by distinguishing between the interpretive function and the interpreted function. It separates the timing measurement from the interpretive function's execution context and specifically targets the interpreted function's execution window, thereby achieving accurate attribution of execution time to the correct function while maintaining a manageable profiling architecture.
Solution Approach 2:
The patent introduces an intermediary mechanism that monitors function calls and returns within the interpretive function. This intermediary tracks the execution context and intercepts timing information to correctly attribute it to the interpreted function rather than the interpretive function, resolving the measurement accuracy issue without requiring complete system redesign.
2Measurement precision
If the profiling system examines the program execution stack to identify interpreted functions, then the profiling accuracy improves, but the execution time increases due to additional overhead
Solution Approach 1:
The profiling system performs preliminary actions by setting up execution stack monitoring before the interpreted function executes. It pre-configures the measurement mechanism to automatically capture timing information when the interpreted function is called and returns, eliminating the need for continuous or post-hoc analysis during execution, thus reducing overall profiling overhead while maintaining identification accuracy.
Solution Approach 2:
The system applies partial monitoring by focusing only on the specific execution stack frames relevant to interpreted function calls. Rather than examining the entire execution stack continuously, it selectively monitors only when interpretive functions are active and their corresponding interpreted functions are executing, reducing the time overhead while preserving measurement precision.
Data Source
AI summary
Aspects of the invention are directed towards profiling computer programs that include interpreted functions. Various implementations provide for profiling a computer program, written in a first programming language, which includes an interpretive function that can execute a computer program, written in a second programming language. During profiling, when the interpretive function is called, the functions of the computer program written in the second programming languages are profiled.


