Compiler Profiling via Persistent Memory Storage
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing profiling techniques generate separate profiling files for each run of a program, making it complex to combine profiling information from multiple runs and limiting the efficiency of code optimization, as they require file access operations and do not allow for shared profiling information between runs.
Innovation Solution
Storing profiling information in a persistent memory region that can be shared and updated across multiple runs, allowing profiling instructions to gather and store execution characteristics, such as instruction frequencies, in a memory location accessible by both the program and the optimizer, eliminating the need for file-based profiling.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If file-based profiling is used to store profiling information for each program run, then profiling information can be preserved across runs, but the build process becomes complex and file access operations reduce profiling efficiency
Solution Approach 1:
The patent replaces the mechanical file-based storage system with a memory-based storage system. Profiling information is stored in memory during program execution and directly accessed by the optimizer, eliminating file I/O operations and reducing build process complexity while preserving profiling information across runs.
Solution Approach 2:
The patent introduces memory as an intermediary between the program execution and the optimizer. Instead of directly reading from files, the optimizer accesses profiling information stored in memory, which simplifies the build process and improves access efficiency.
2Quantity of substance
If separate profiling files are generated for each program run, then profiling information from multiple runs can be collected, but combining this information becomes complex and time-consuming
Solution Approach 1:
The patent merges multiple profiling information sources into a single memory-based storage location. Instead of generating separate files for each run that need to be combined, all profiling information from multiple runs is stored in the same memory location, allowing the optimizer to access consolidated information without additional combination steps.
Solution Approach 2:
The patent enables continuous profiling information collection in memory across multiple program runs without interruption. The memory-based system allows profiling information to be accumulated continuously and made immediately available to the optimizer, eliminating the time loss associated with file-based combination operations.
3Loss of information
If file access operations are used to retrieve profiling information, then profiling data can be obtained, but the efficiency of code optimization is reduced due to additional I/O overhead
Solution Approach 1:
The patent substitutes file I/O operations with memory access operations. Profiling information is retrieved from memory rather than from files, eliminating the I/O overhead and significantly improving code optimization efficiency while maintaining complete access to profiling information.
Data Source
Figure 1
Figure 2
Figure 3A~3C
AI summary
The technology disclosed herein enables a processor to receive program code comprising a plurality of program code instructions generated by a compiler in view of source code, identify, among the program code instructions, one or more optimizable instructions, wherein at least one of the optimizable instructions is associated with an execution characteristic, and the execution characteristic is associated with an optimization decision, identify a profiling instruction location associated with the at least one of the optimizable instructions, and add a profiling instruction to the program code at the profiling instruction location. The at least one profiling instruction comprises a profiling identifier, and causes the processing device to: generate a profiling information item in view of the execution characteristic of the optimizable instructions, and store the profiling information item in a persistent memory region at a memory location corresponding to the profiling identifier.