Graph-Based Code Performance Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Software development organizations face challenges in identifying and pinpointing issues introduced during code changes, such as bugs or inefficiencies, which can break functionality and decrease performance, especially in front-end code where traditional testing methods like line number coverage are inadequate.
Innovation Solution
The method involves instrumenting code with annotations to track function calls, generating a call graph that maps dependencies among functions, and using this data to ensure adequate code coverage, analyze the impact of changes, and provide optimization recommendations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If traditional testing methods like line number coverage are used, then testing can be performed, but they are inadequate for front-end code and cannot precisely identify issues introduced during code changes
Solution Approach 1:
The patent segments the codebase into functions and tracks them individually using unique identifiers. By breaking down the code into discrete, trackable units (functions with unique IDs), the system can precisely identify which specific function introduced a bug, rather than relying on imprecise line number coverage. This segmentation enables granular tracking of function calls and dependencies across multiple source files.
Solution Approach 2:
The patent introduces an intermediary instrumentation layer that wraps function calls and inserts tracking code. This intermediary layer captures function entry/exit information, call stacks, and dependencies without modifying the original business logic. The instrumentation acts as a mediator between the executed code and the analysis system, enabling precise issue identification while maintaining code functionality.
2Loss of information
If code is instrumented with annotations to track function calls, then precise dependency mapping is achieved, but the code complexity and overhead increase
Solution Approach 1:
The patent extracts dependency tracking functionality from the business logic into separate instrumentation code. By taking out the tracking concerns and placing them in dedicated annotation and instrumentation layers, the system achieves complete dependency information without permanently increasing the complexity of the core code. The extracted tracking code can be automatically generated and removed or minimized in production builds.
Solution Approach 2:
The patent changes the parameter representation from traditional line numbers to unique function identifiers. This parameter change enables more accurate tracking and mapping of function dependencies. By using unique function IDs instead of line numbers, the system can reliably track function calls across minified and obfuscated code, maintaining information completeness while simplifying the analysis process.
3Reliability
If comprehensive function tracking is implemented across multiple source files, then complete call graph is generated, but the processing time and computational resources increase
Solution Approach 1:
The patent performs preliminary instrumentation of code during the build or development phase, inserting tracking annotations before execution. This preliminary action ensures that all necessary tracking data is captured during code execution without requiring post-execution analysis. The call graph is constructed incrementally as functions are executed, rather than requiring complete static analysis of all source files, thereby reducing processing time while maintaining accuracy.
4Measurement precision
If detailed annotations are added to each function to track entry and calls, then complete execution information is captured, but the code size and complexity increase
Solution Approach 1:
The patent uses unique function identifiers as copies or references to function metadata rather than embedding full function definitions or detailed annotations in the executed code. Each function is assigned a unique ID that serves as a compact reference, allowing precise execution tracking without duplicating large amounts of code. This copying approach maintains measurement precision while minimizing the increase in code size.
Data Source
AI summary
Techniques are described for graph based code performance analysis of software, such as software that is being developed and tested in a development environment. Implementations provide a technique for instrumenting code by adding various annotations into the code. Each annotation may be a function call that executes with the annotated code, but does not alter the behavior and/or functionality of the annotated code apart from outputting call tracking information during execution. The call tracking information generated by annotations can be analyzed to generate a call graph that depicts calling relationships between functions in the code. The call graph can be presented within a user interface and/or automatically analyzed to develop recommendations regarding code coverage for testing, impact information describing how changes to one function impact another function, code optimization recommendations, and so forth.


