Instruction Processing Code Cache Threshold Adjustment
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The performance of instruction processing is reduced due to garbage collection (GC) in a code cache, as translated code is removed, leading to sequential interpretation of high-frequency instructions, which decreases execution speed until the execution frequency exceeds the threshold again.
Innovation Solution
Generating a translated code block for high-frequency instructions and storing it in a first storage unit, then reducing the execution threshold temporarily after removing some or all of the translated code block, allowing for earlier regeneration of translated code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If translated code is removed from code cache during garbage collection to make space for new translated code, then the code cache can accommodate more translated code, but the execution speed of frequently executed instructions is reduced because they must be sequentially interpreted again
Solution Approach 1:
The system performs preliminary action by reducing the execution threshold before garbage collection occurs. This allows the system to proactively regenerate translated code for frequently executed instructions before they are removed from the code cache, ensuring that when GC happens, the instructions are already translated and ready for fast execution, thus avoiding the performance penalty of sequential interpretation after GC
Solution Approach 2:
The system uses feedback from the execution threshold mechanism to dynamically adjust translation decisions. By monitoring execution frequency and comparing it against the threshold (which is temporarily reduced before GC), the system receives feedback about which instructions are candidates for translation, allowing it to prioritize translation of high-frequency instructions that would otherwise suffer performance degradation after GC
2Device complexity
If the execution threshold is kept high to avoid unnecessary translation requests, then the system maintains lower overhead for translation requests, but the time required for performance recovery after garbage collection increases
Solution Approach 1:
The system applies dynamics by making the execution threshold adjustable rather than fixed. The threshold is dynamically changed based on the GC schedule - reduced before GC to accelerate translation of frequently executed instructions, and restored afterward. This dynamic adjustment allows the system to optimize for fast performance recovery during critical periods while maintaining normal operation during other periods
Solution Approach 2:
The system implements periodic action by temporarily reducing the execution threshold in periodic intervals synchronized with the garbage collection schedule. This periodic threshold reduction creates windows of accelerated translation activity that align with GC cycles, ensuring that translated code is regenerated before it would be removed, thereby periodically recovering performance without permanent threshold changes
Data Source
AI summary
An instruction processing method includes generating a translated code block for an instruction, among instructions included in a target program to be executed and for which a number of executions through sequential interpretation is greater than or equal to a threshold, and storing the generated translated code block in a first storage unit and removing part or all of the translated code block from the first storage unit at a given timing, wherein the generating reduces the threshold with respect to the number of executions over a given period of time after the part or all of the translated code block is removed.


