Method for analyzing code execution efficiency of application program
Through the combination of code segmentation and analysis mode, the problem of low accuracy of code execution efficiency analysis in the existing technology is solved, and more accurate and intelligent code execution efficiency analysis and compensation is achieved, improving the analysis effect.
Patent Information
- Application Number
- CN202311664863.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2043-12-06
Smart Images

Figure CN118916252A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software, and in particular to a method for analyzing the execution efficiency of application code. Background Art
[0002] With the development of computer software technology, more and more intelligent electronic devices need to use codes to realize their functions. As the functions that electronic devices need to realize increase, the codes that need to be written become more and more complex. Therefore, the execution efficiency of the written codes has become a hot issue in computer software technology.
[0003] Chinese Patent Publication No.: CN104572451A discloses a code efficiency checking method and system, including: a code file acquisition step, including: acquiring an unchecked code file as a current code file, the code file including at least one code, taking the first code of the code file as the current code, and executing a code checking step;
[0004] The code checking step includes: checking the current code: if the current code is the start mark of the loop segment, adding the loop mark to the preset queue, and executing the code end judgment step; if the current code meets the preset efficiency rule, and the loop mark is still stored in the queue, an alarm record is made, and the code end judgment step is executed; if the current code is the end mark of the loop segment, removing the loop mark from the queue, and executing the code end judgment step;
[0005] The code end judgment step includes: if the code file has a next code, taking the next code as the current code and executing the code checking step; otherwise, executing the project end judgment step;
[0006] The project end judgment step includes: setting the current code file as a checked code file, if there are unchecked code files, executing the code file acquisition step, otherwise ending.
[0007] A code efficiency checking system, comprising:
[0008] The code file acquisition module is used to: acquire an unchecked code file as a current code file, wherein the code file includes at least one code, take the first code of the code file as the current code, and execute the code checking module;
[0009] The code checking module is used to check the current code: if the current code is the start mark of the loop segment, the loop mark is added to the preset queue, and the code end judgment module is executed; if the current code meets the preset efficiency rules, and the loop mark is still stored in the queue, an alarm record is made and the code end judgment module is executed; if the current code is the end mark of the loop segment, the loop mark is removed from the queue and the code end judgment module is executed;
[0010] The code end judgment module is used to: if the code file has a next code, use the next code as the current code and execute the code checking module; otherwise, execute the project end judgment module;
[0011] The project end judgment module is used to: set the current code file as the checked code file, if there is an unchecked code file, execute the code file acquisition module, otherwise end.
[0012] It can be seen that the existing technology has the problem of low accuracy in controlling the code execution efficiency analysis, which leads to the problem of insufficient accuracy and low intelligence in the code execution efficiency analysis. Summary of the invention
[0013] To this end, the present invention provides a method for analyzing application code execution efficiency to overcome the problem that the control accuracy of code execution efficiency analysis in the prior art is low, resulting in insufficient accuracy and low intelligence of code execution efficiency analysis.
[0014] To achieve the above object, a method for analyzing the execution efficiency of application code includes:
[0015] Step S1, the code segmentation unit of the code acquisition module segments the code text to be analyzed according to the segmentation method to obtain segmented codes, and passes the codes to the code analysis module;
[0016] Step S2: The code analysis module determines an analysis mode of code execution efficiency according to the type of code and the time complexity of the code;
[0017] Step S3: The code classification unit of the code analysis module classifies each section of code with low execution efficiency according to a preset rule, and the space classification unit of the code analysis module classifies the space of the memory according to a preset rule;
[0018] Step S4: The code analysis module determines a compensation mode for the code execution module according to the type of code with low execution efficiency;
[0019] Step S5: The code analysis module determines whether the code execution module optimizes the analysis process according to a comparison result of the improved execution efficiency value and a preset improved execution efficiency value.
[0020] Furthermore, the segmentation method of the code segmentation unit is to segment the code text to be analyzed line by line, and when encountering a code keyword, the code segmentation unit segments the code into segments; the preset rules include the rules for code classification by the code classification unit and the rules for memory space classification by the space classification unit.
[0021] Furthermore, the code analysis module determines an analysis mode according to the type of code received after segmentation by the code segmentation unit, and analyzes the code line in a first analysis mode when the code type is a code line, and analyzes the code segment in a second analysis mode when the code type is a code segment.
[0022] Furthermore, the first analysis mode includes that when the code type after segmentation is a code line, the code analysis module determines the execution efficiency of the code based on the comparison result of the execution time of the code line and the preset execution time, and determines that the execution efficiency of the code is low when the execution time of the code line is greater than or equal to the preset execution time, and determines that the execution efficiency of the code is high when the execution time of the code line is less than the preset execution time.
[0023] Furthermore, the first analysis mode also includes the code analysis module determining the execution efficiency of the code segment based on the comparison result of the average execution time of the code lines in the code segment and the preset execution time when the code type after segmentation is a code segment, and determining that the execution efficiency of the code segment is low when the average execution time of the code lines is greater than or equal to the preset execution time, and determining that the execution efficiency of the code segment is high when the average execution time of the code lines is less than the preset execution time.
[0024] Furthermore, the second analysis mode includes the code analysis module determining the execution efficiency of the code based on a comparison result of the time complexity of the code segment with the minimum time complexity, and determining that the execution efficiency of the code segment is low under the condition that the time complexity of the code segment is greater than the minimum time complexity, and determining to analyze the code segment in the first analysis mode under the condition that the time complexity of the code segment is equal to the minimum time complexity.
[0025] Furthermore, when the code analysis module obtains a code segment with low execution efficiency, the code analysis module determines a compensation mode according to the type of the code segment, and determines to compensate the code with the first compensation mode of the code execution module under the condition that the code segment type is a frequently running code; determines to compensate the code with the second compensation mode under the condition that the code segment type is a code with slow execution speed among infrequently running codes; and determines to compensate the code with the third compensation mode under the condition that the code segment type is a code with large code capacity among infrequently running codes.
[0026] Furthermore, the first compensation mode includes the code execution module allocating the code to a tightly coupled memory space; the second compensation mode includes the code execution module allocating the code to a static random access memory space; and the third compensation mode includes the code execution module allocating the code to a static random access memory space.
[0027] Furthermore, the code analysis module performs a secondary analysis of the code execution efficiency of the optimized code text, and determines whether the code execution module optimizes the analysis process based on the comparison result of the improved execution efficiency value with the preset improved execution efficiency value, and determines that the code execution module optimizes the analysis process under the condition that the compensation effect is less than the preset compensation effect.
[0028] Furthermore, the preset rules include rules for code classification by a code classification unit, and the code classification unit classifies the code according to the number of executions of each code segment, the execution time and attributes of a single line of code; the preset rules also include rules for memory space classification by a space classification unit, and the space classification unit classifies the storage space according to the running speed.
[0029] Compared with the prior art, the beneficial effect of the present invention lies in that the example of the present invention performs code segmentation on the initial code text through the code segmentation unit set in the data acquisition module, and the segmentation method is line-by-line segmentation, and when the code segmentation unit detects a code keyword, it switches the working mode to segmentation by paragraphs; through the above method, the code analysis module can quickly determine the type of the segmented code and then determine the analysis method of the code according to the code type, thereby improving the analysis efficiency of the code execution efficiency and the accuracy of the analysis of the code execution efficiency.
[0030] Furthermore, the example of the present invention determines the execution efficiency of a code segment by calculating the complexity of each code segment. Generally speaking, the higher the time complexity, the lower the code execution efficiency. In addition, the code analysis module adopts a first analysis mode for code segments of the same complexity to determine the execution time of the code and then determine the code execution efficiency. Through the above method, the code analysis module can perform corresponding analysis according to code segments of different complexities, thereby improving the accuracy and controllability of the code execution efficiency analysis, and thereby improving the intelligence of the code execution efficiency analysis.
[0031] Furthermore, the present invention further analyzes the code segment with high time complexity through the code analysis module, so as to judge the code execution efficiency of the code segment with high time complexity and another replaceable code segment, and then selects the corresponding method for judgment according to whether the time complexity is the same. Through the above method, the code analysis module can judge the code execution efficiency of the code segment more comprehensively and accurately, avoid misjudgment of the code execution efficiency, and thus improve the accuracy of the code execution efficiency analysis.
[0032] Furthermore, in an example of the present invention, a code classification unit is used to classify codes with low execution efficiency according to preset rules, and a space classification unit is used to classify storage space of the memory according to preset rules. A code analysis module determines a compensation mode according to the type of code segment. Through the above method, the code analysis module can more accurately determine the compensation mode according to the type of each code segment, thereby improving the accuracy and intelligence of the code execution efficiency analysis.
[0033] Furthermore, the example of the present invention compensates for the code with low execution efficiency by adding a compensation mode to improve the execution efficiency of the code. The code analysis module allocates the classified code with low execution efficiency to the corresponding storage space according to its type to improve the execution efficiency of the code. Through the above method, the code analysis module can determine the compensation mode for the code with low execution efficiency more comprehensively and accurately, thereby improving the accuracy of the code execution efficiency analysis.
[0034] Furthermore, the present invention determines whether to adjust the preset execution time with an adjustment coefficient by comparing the execution efficiency value improved by the code text with the preset execution efficiency value based on the total execution time obtained by the first code execution efficiency analysis and the total execution time obtained by the second code execution efficiency analysis through the code analysis module. Through the above method, the code analysis module can more intuitively and clearly obtain the execution efficiency value improved by the code text, thereby analyzing the code execution efficiency more accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A diagram of the operation steps of a method for analyzing the execution efficiency of application code according to an embodiment of the present invention;
[0036] Figure 2 A structural diagram of a method for analyzing application code execution efficiency according to an embodiment of the present invention;
[0037] Figure 3 This is a structural diagram of a code analysis module of a method for analyzing application code execution efficiency according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0039] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0040] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0041] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0042] An embodiment of the present invention provides a method for analyzing the execution efficiency of application code, including:
[0043] Step S1, the code segmentation unit of the code acquisition module segments the code text to be analyzed according to the segmentation method to obtain segmented codes, and passes the codes to the code analysis module;
[0044] Step S2: The code analysis module determines an analysis mode of code execution efficiency according to the type of code and the time complexity of the code;
[0045] Step S3: The code classification unit of the code analysis module classifies each section of code with low execution efficiency according to a preset rule, and the space classification unit of the code analysis module classifies the space of the memory according to a preset rule;
[0046] Step S4: The code analysis module determines a compensation mode for the code execution module according to the type of code with low execution efficiency;
[0047] Step S5: The code analysis module determines whether the code execution module optimizes the analysis process according to a comparison result of the improved execution efficiency value and a preset improved execution efficiency value.
[0048] In an embodiment of the present invention, the segmentation method of the code segmentation unit is to segment the code text to be analyzed line by line. When encountering a code keyword, the code segmentation unit segments the code into segments, wherein the code keyword includes but is not limited to "while, for or switch"; the end mark of the segment segmentation is determined according to the code language type, for example, when the code to be analyzed is in C or C++ language, the end mark is "}"; the preset rules include rules for classifying the code by a code classification unit, and the code classification unit classifies the code according to the number of executions of each code segment, the execution time and attributes of a single line of code; the preset rules also include rules for classifying the memory space by a space classification unit, and the space classification unit classifies the storage space according to the running speed.
[0049] Specifically, the code classification unit classifies each code segment into frequently-running code and infrequently-running code according to the number of times each code segment is executed; the code classification unit classifies the infrequently-running code into code with slow execution speed and code with large code capacity according to the execution time of a single line of code of each code segment and the number of lines of code in each code segment; the space classification unit divides the space of the chip memory into tightly-coupled memory space, static random access memory space and dynamic random access memory space according to the running speed, and the running speed decreases from front to back.
[0050] Specifically, when the code analysis module receives that the code type after segmentation by the code segmentation unit is a code line, it selects a first analysis mode to analyze the code line; when the code analysis module receives that the code type after segmentation by the code segmentation unit is a code segment, it selects a second analysis mode to analyze the code segment.
[0051] Specifically, the example of the present invention performs code segmentation on the initial code text through a code segmentation unit set in the data acquisition module, and the segmentation method is line-by-line segmentation, and when the code segmentation unit detects a code keyword, it switches the working mode to segmentation by paragraphs; through the above method, the code analysis module can quickly determine the type of the segmented code and then determine the analysis method of the code according to the code type, thereby improving the analysis efficiency of the code execution efficiency and the accuracy of the analysis of the code execution efficiency.
[0052] Specifically, when the code analysis module analyzes the code line in the first analysis mode, the code analysis module performs a secondary determination based on the segmented code type, and when the code analysis module analyzes the code line in the first analysis mode, the code analysis module determines the execution efficiency of the code based on the comparison result of the execution time T1 of the code line and the preset execution time T0;
[0053] When T1 ≥ T0, the unit analysis mode determines that the execution efficiency of the code is low;
[0054] When T1<T0, the unit analysis mode determines that the execution efficiency of the code is high;
[0055] The value of T0 is the ratio of the total execution time of the code text to be analyzed to the total number of code executions of the code text to be analyzed.
[0056] When the code analysis module analyzes the code segment in the first analysis mode, the code analysis module determines the execution efficiency of the code segment according to the comparison result of the average execution time T2 of the code lines in the code segment and the preset execution time T0;
[0057] When T2≥T0, the code analysis module determines that the execution efficiency of the code segment is low;
[0058] When T2<T0, the code analysis module determines that the execution efficiency of the code segment is high;
[0059] The average execution time of the code segment is calculated by the following formula:
[0060]
[0061] Among them, Ti represents the execution time of the i-th line of code, Mi represents the number of times the i-th line of code is executed, and N represents the total number of code lines.
[0062] Specifically, the example of the present invention determines the average execution time of the code segment by calculating the sum of the execution time of each line of code, and the code analysis module determines the execution efficiency of the code segment by comparing the average execution time of the code segment with the preset execution time. Through the above method, the code analysis module can accurately obtain the average execution time of each code segment, and then determine the execution efficiency of the code segment, thereby improving the accuracy of the code execution efficiency analysis.
[0063] Specifically, when the code analysis module analyzes the code segment in the second analysis mode, the code analysis module determines the execution efficiency of the code according to the comparison result of the time complexity T(n) of the code segment and the minimum time complexity O(1);
[0064] When T(n)>O(1), the code analysis module determines that the execution efficiency of the code segment is low;
[0065] When T(n)=O(1), the code analysis module analyzes the code segment in a first analysis mode.
[0066] Among them, when the time complexity of the code segment is greater than the minimum time complexity, the code analysis module determines that the execution efficiency of the code segment is low relative to the average execution efficiency of the code text to be analyzed. In addition, when the time complexity of the two code segments of the code analysis module is greater than the minimum time complexity, the code analysis module determines the execution efficiency of the code segment based on the time complexity, data size and execution time.
[0067] Specifically, the example of the present invention determines the execution efficiency of a code segment by calculating the complexity of each code segment. Generally speaking, the higher the time complexity, the lower the code execution efficiency. In addition, the code analysis module adopts a first analysis mode for code segments of the same complexity to determine the execution time of the code and then determine the code execution efficiency. Through the above method, the code analysis module can perform corresponding analysis according to code segments of different complexities, thereby improving the accuracy and controllability of the code execution efficiency analysis, and thereby improving the intelligence of the code execution efficiency analysis.
[0068] Specifically, when the time complexity of the two code segments is the same, the code analysis module determines the code execution efficiency of the two code segments according to the execution time of the code segments, and the code execution efficiency of the code segment with a shorter execution time is higher; when the time complexity of the two code segments is different, the data analysis mode determines the code execution efficiency according to the size of the time complexity of the two code segments, but the code execution efficiency of the code segment with a lower time complexity is not necessarily higher; the time complexity is affected by the algorithm and the code size, and the specific analysis of the complexity of a code segment needs to take the code size into consideration.
[0069] Specifically, the present invention further analyzes the code segment with high time complexity through the code analysis module, so as to judge the code execution efficiency of the code segment with high time complexity and another replaceable code segment, and then selects the corresponding method for judgment according to whether the time complexity is the same. Through the above method, the code analysis module can judge the code execution efficiency of the code segment more comprehensively and accurately, avoid misjudgment of the code execution efficiency, and thus improve the accuracy of the code execution efficiency analysis.
[0070] Specifically, when the code analysis module analyzes a code segment with low execution efficiency, the code analysis module determines a compensation mode according to the type of the code segment;
[0071] When the code segment type is a frequently-running code, the code analysis module determines that the code execution module compensates the code in a first compensation mode;
[0072] When the code segment type is a code with a slow execution speed in the infrequently executed code, the code analysis module determines that the code execution module compensates the code in a second compensation mode;
[0073] When the code segment type is a code with a large code capacity in the infrequently executed code, the code analysis module determines that the code execution module compensates the code in a third compensation mode.
[0074] Specifically, the example of the present invention classifies codes with low execution efficiency according to preset rules through a code classification unit, and at the same time, a space classification unit also classifies the storage space of the memory according to preset rules. The code analysis module determines the compensation mode according to the type of the code segment. Through the above method, the code analysis module can more accurately judge the compensation mode according to the type of each code segment, thereby improving the accuracy and intelligence of the code execution efficiency analysis.
[0075] Specifically, when the code execution module compensates the frequently running code in the first compensation mode, the code execution module allocates the code to the tightly coupled memory space; when the code execution module compensates the slow execution speed code in the infrequently running code in the second compensation mode, the code execution module allocates the code to the static random access memory space; when the code execution module compensates the slow execution speed code in the infrequently running code in the third compensation mode, the code execution module allocates the code to the static random access memory space.
[0076] Specifically, the example of the present invention compensates for the code with low execution efficiency by adding a compensation mode to improve the execution efficiency of the code. The code analysis module determines the code execution module according to the type of the classified code with low execution efficiency and allocates it to the corresponding storage space to improve the execution efficiency of the code. Through the above method, the code analysis module can determine the compensation mode for the code with low execution efficiency more comprehensively and accurately, thereby improving the accuracy of the code execution efficiency analysis.
[0077] Specifically, when the code analysis module performs a secondary analysis of the code execution efficiency on the optimized code text, the code analysis module determines the execution efficiency value of the code text according to the total execution time Ta obtained by the first code execution efficiency analysis and the total execution time Tb obtained by the second code execution efficiency analysis, and the code analysis module determines whether to start the optimization according to the comparison result of the improved execution efficiency value and the preset improved execution efficiency value P0;
[0078] When P≥P0, the code analysis module determines not to enable optimization;
[0079] When P<P0, the code analysis module determines to start optimization;
[0080] The preset improved execution efficiency value P0 is set to 50% of the proportion of the code with low execution efficiency in the code text to be analyzed. Those skilled in the art can adjust the value according to actual needs. The improved execution efficiency value P is calculated by the following formula:
[0081]
[0082] Specifically, when the code analysis module determines to optimize the preset execution time T0, the code execution module adjusts the preset execution time T0 by adding an adjustment coefficient, and the adjustment coefficient K is calculated by the following formula:
[0083]
[0084] The adjusted preset execution time is set to T0'=K×T0.
[0085] Specifically, the present invention determines whether to adjust the preset execution time with an adjustment coefficient by comparing the execution efficiency value improved by the code text with the preset execution efficiency value according to the total execution time obtained by the first code execution efficiency analysis and the total execution time obtained by the second code execution efficiency analysis through the code analysis module. Through the above method, the code analysis module can obtain the execution efficiency value improved by the code text more intuitively and clearly, thereby analyzing the code execution efficiency more accurately.
[0086] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. The present invention relates to a method for analyzing the execution efficiency of application code, characterized in that: include: Step S1, the code segmentation unit of the code acquisition module segments the code text to be analyzed according to the segmentation method to obtain segmented codes, and passes the codes to the code analysis module; Step S2: The code analysis module determines an analysis mode of code execution efficiency according to the type of code and the time complexity of the code; Step S3: The code classification unit of the code analysis module classifies each section of code with low execution efficiency according to a preset rule, and the space classification unit of the code analysis module classifies the space of the memory according to a preset rule; Step S4: The code analysis module determines a compensation mode for the code execution module according to the type of code with low execution efficiency; Step S5: The code analysis module determines whether the code execution module optimizes the analysis process according to a comparison result of the improved execution efficiency value and a preset improved execution efficiency value.
2. A method for analyzing application code execution efficiency according to claim 1, characterized in that: The segmentation method of the code segmentation unit is to segment the code text to be analyzed line by line. When encountering a code keyword, the code segmentation unit segments the code into segments; the preset rules include the rules for code classification by the code classification unit and the rules for memory space classification by the space classification unit.
3. A method for analyzing application code execution efficiency according to claim 2, characterized in that: The code analysis module determines an analysis mode according to the code type received after the code segmentation unit segments the code, and analyzes the code line in a first analysis mode when the code type is a code line, and analyzes the code segment in a second analysis mode when the code type is a code segment.
4. The method for analyzing the execution efficiency of application code according to claim 3, characterized in that: The first analysis mode includes, when the code type after segmentation is a code line, the code analysis module determines the execution efficiency of the code based on the comparison result of the execution time of the code line and the preset execution time, and determines that the execution efficiency of the code is low when the execution time of the code line is greater than or equal to the preset execution time, and determines that the execution efficiency of the code is high when the execution time of the code line is less than the preset execution time.
5. A method for analyzing application code execution efficiency according to claim 4, characterized in that: The first analysis mode also includes the code analysis module determining the execution efficiency of the code segment based on the comparison result of the average execution time of the code lines in the code segment and the preset execution time when the code type after segmentation is a code segment, and determining that the execution efficiency of the code segment is low when the average execution time of the code lines is greater than or equal to the preset execution time, and determining that the execution efficiency of the code segment is high when the average execution time of the code lines is less than the preset execution time.
6. A method for analyzing application code execution efficiency according to claim 5, characterized in that: The second analysis mode includes the code analysis module determining the execution efficiency of the code based on a comparison result of the time complexity of the code segment with the minimum time complexity, and determining that the execution efficiency of the code segment is low under the condition that the time complexity of the code segment is greater than the minimum time complexity, and determining to analyze the code segment in the first analysis mode under the condition that the time complexity of the code segment is equal to the minimum time complexity.
7. A method for analyzing application code execution efficiency according to claim 6, characterized in that: When the code analysis module obtains a code segment with low execution efficiency, the code analysis module determines a compensation mode according to the type of the code segment, and determines to compensate the code in the first compensation mode of the code execution module under the condition that the code segment type is a frequently running code, determines to compensate the code in the second compensation mode of the code execution module under the condition that the code segment type is a code with slow execution speed among infrequently running codes, and determines to compensate the code in the third compensation mode of the code execution module under the condition that the code segment type is a code with large code capacity among infrequently running codes.
8. The method for analyzing the execution efficiency of application code according to claim 7, characterized in that: The first compensation mode includes the code execution module allocating the code to a tightly coupled memory space; the second compensation mode includes the code execution module allocating the code to a static random access memory space; and the third compensation mode includes the code execution module allocating the code to a static random access memory space.
9. The method for analyzing the execution efficiency of application code according to claim 8, characterized in that: The code analysis module performs a secondary analysis of the code execution efficiency on the optimized code text. The code analysis module determines whether the code execution module optimizes the analysis process based on the comparison result of the improved execution efficiency value and the preset improved execution efficiency value, and determines that the code execution module optimizes the analysis process under the condition that the compensation effect is less than the preset compensation effect.
10. The method for analyzing the execution efficiency of application code according to claim 9, characterized in that: The preset rules include rules for classifying codes by a code classification unit, and the code classification unit classifies codes according to the number of executions of each code segment, the execution time and attributes of a single line of code; the preset rules also include rules for classifying memory spaces by a space classification unit, and the space classification unit classifies storage spaces according to running speed.
Citation Information
Patent Citations
Method for measuring code segment execution time and terminal equipment
CN110580220A
Analysis report generation method and device, electronic equipment and storage medium
CN113886237A
Abnormal code processing method and device, computer equipment and storage medium
CN115185833A
Code optimization method and optimizer thereof
CN115658141A
A security system and method for e-mail
KR101989509B1
