Automated API Performance Profiling System
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Software engineers lack quantitative information for making design decisions regarding Application Programming Interface (API) performance costs, which are complex and vary with input parameters and hardware, leading to inaccurate measurement and neglect of cost considerations in API design.
Innovation Solution
An automated API performance profiler system that collects precise time-to-execute and memory allocation data using specialized profilers, ensuring minimal overhead and accurate measurement by isolating function calls and using log base 2 bucketing for statistical analysis, allowing for the creation of performance profiles that reflect real-world scenarios.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If existing profiling tools are used to measure API execution time, then timing data can be collected, but the measurement overhead accumulates and distorts the results particularly for functions called multiple times
Solution Approach 1:
The patent segments the measurement process into two distinct phases: (1) an instrumentation phase where timing code is inserted into the target program, and (2) a data collection phase where the instrumented program is executed. This segmentation allows the measurement overhead to be separated from the actual execution time measurement, preventing cumulative distortion of results.
Solution Approach 2:
The patent applies preliminary action by pre-instrumenting the target program with timing code before execution. The instrumentation process prepares the program by inserting timing measurements at specified API call sites, so that when the program is executed, the measurements are already in place and do not interfere with the natural execution flow.
2Loss of information
If detailed timing measurements are taken for all functions in a call tree, then comprehensive performance data is obtained, but the cumulative measurement cost dramatically alters results for higher-level functions
Solution Approach 1:
The patent extracts the measurement function from the execution flow by using pre-instrumented code that measures timing without allowing the measurement process itself to contribute to the cumulative timing cost. The timing measurements are taken out of the critical execution path in a way that prevents them from being included in the measured results.
3Reliability
If memory allocation and execution time data are collected for broad range of scenarios, then statistically significant performance profiles are generated, but the data collection process requires multiple separate executions
Solution Approach 1:
The patent creates a universal instrumentation framework that can collect both memory allocation data and execution time data through the same pre-instrumented program structure. This multi-functional approach allows comprehensive performance profiling across multiple dimensions without requiring separate instrumentation processes for each type of measurement.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method to measure the performance of an Application Programming Interface (API) includes selecting a target API and tracking memory allocation for the functional calls of the selected API to generate a list of functions called by the API. The individual functions are then called within the API in isolation and timing and memory allocation data for each are collected and recorded. The recorded results are then bucketized according to a log base 2 method and made accessible by API users to indicate the performance of specific APIs.