WO2012056569A1 - Performance measurement method, performance measurement device, and performance measurement program - Google Patents

Performance measurement method, performance measurement device, and performance measurement program Download PDF

Info

Publication number
WO2012056569A1
WO2012056569A1 PCT/JP2010/069335 JP2010069335W WO2012056569A1 WO 2012056569 A1 WO2012056569 A1 WO 2012056569A1 JP 2010069335 W JP2010069335 W JP 2010069335W WO 2012056569 A1 WO2012056569 A1 WO 2012056569A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
execution time
performance
execution
extracted
Prior art date
Application number
PCT/JP2010/069335
Other languages
French (fr)
Japanese (ja)
Inventor
真哉 南谷
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2010/069335 priority Critical patent/WO2012056569A1/en
Publication of WO2012056569A1 publication Critical patent/WO2012056569A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/88Monitoring involving counting

Definitions

  • the present invention relates to a performance measurement method, and more particularly to a performance measurement method for measuring the performance of a program.
  • a program developer or the like inputs a specific input to the program, and the system corresponding thereto Measure the processing performance.
  • the developer or the like needs to specify a part of the program that has a problem with the processing performance.
  • a general method that has been used in the past is to use a function embedded in the program in advance to output a log to the program being executed, and the output time from the start to the end of the entire processing of the program based on the output log There is a way to get it.
  • such a method can acquire the execution time only with rough accuracy.
  • a profiler that measures an execution time of each method by using a profiling function provided in an OS or a virtual machine. According to this method, the execution performance of the program can be analyzed with more detailed accuracy by using the profiler. The problem can be solved when the program is optimized or there is a problem in the processing performance.
  • Patent Document 1 discloses a technique for measuring the execution time with detailed accuracy only for the main method in the second measurement.
  • Patent Document 1 measures all methods corresponding to a specific input and generates statistical information (average execution time, number of executions). For this reason, when measuring a program whose overall execution time is very short, the technique disclosed in Patent Document 1 cannot acquire an accurate execution time, and a method that is actually a bottleneck is not extracted as a main method. There is.
  • the predetermined threshold value used in the technique disclosed in Patent Document 1 is a constant value for any method. For this reason, for example, when comparing performance between two programs, a program that has been modified that affects performance and a program that has not been modified, the execution time is compared with the execution time of the entire program.
  • the technique disclosed in Patent Document 1 cannot be used for the purpose of identifying a method in which there is a significant difference in the performance of the method before and after the correction.
  • the present invention has been made in view of such problems, and can accurately specify a method that affects the processing performance, and can improve the processing performance by the measurement itself regardless of the scale of the program for measuring the processing performance.
  • the purpose is to provide a measurement method that reduces the influence.
  • an object of the present invention is to provide a performance measurement method for specifying a method in which a difference in performance occurs between a plurality of programs.
  • a typical example of the present invention is as follows. That is, a performance measurement method for measuring the performance of a program by a computer, wherein the computer includes a processor and a memory for storing a program executed by the processor, and the method includes: A procedure for first determining at least one first method among methods directly called by a program to be measured, and execution of each determined first method by the computer executing the program Using the time measurement procedure and the execution time of each measured first method, the computer can extract at least one second method that matches a predetermined condition from each first method.
  • a procedure for determining whether or not the at least one second method can be extracted A procedure for determining whether or not at least one third method called directly from each extracted second method can be extracted, and when the at least one third method can be extracted, A procedure for determining the extracted third method as a first method; a procedure for the computer to measure the execution time; and a procedure for determining whether or not the second method can be extracted; And a procedure for repeatedly executing a procedure for determining whether or not the third method can be extracted and a procedure for determining the third method as the first method.
  • FIG. 1 is a block diagram illustrating a configuration of a computer 100 that analyzes a performance difference between a plurality of programs according to the first embodiment of this invention.
  • the computer 100 includes an arithmetic device 101, a memory 102, an external storage device 103, an output device 104, and an input device 105.
  • the computer 100 is a device having a function of analyzing a difference in processing performance of a plurality of programs.
  • the arithmetic unit 101 is a processor such as a CPU.
  • the arithmetic device 101 executes a program in the memory 102.
  • the memory 102 is a storage device having an area for temporarily storing data.
  • the memory 102 holds programs and tables.
  • the external storage device 103 is a storage device such as a hard disk drive. An argument or the like input to a program executed by the arithmetic device 101 is held.
  • the output device 104 is a device such as a display or a printer. This is an apparatus for providing a result of processing by the computer 100 to a user.
  • the input device 105 is a device such as a keyboard or a mouse. A user inputs an argument or the like input to a program executed by the arithmetic device 101 to the computer 100 via the input device 105.
  • the memory 102 includes a control unit 106, a test execution unit 107, a method call verification unit 108, a performance difference factor method determination unit 109, a version switching unit 110, a first method call table 111, a second method call table 112, and a target method table 113.
  • the second program 121, the Java VM 122, and the JVMTI 123 are programs.
  • the first method call table 111, the second method call table 112, the target method table 113, the first execution information table 114, the second execution information table 115, and the measurement result table 116 are tables in which data is stored.
  • the control unit 106 causes the version switching unit 110 to switch to a state where the first program 120 or the second program 121 can be executed, and causes the test execution unit 107 to execute (test) the first program 120 or the second program 121.
  • the program executed in the memory 102 is controlled, for example, the measurement results obtained by executing the first program 120 or the second program 121 are synchronized.
  • the test execution unit 107 inputs a predetermined value designated in advance by the user to a program that is in an executable state of the first program 120 or the second program 121, and the first program 120 or the second program 121. Execute. Then, the first program 120 or the second program 121 is executed by applying a load necessary for measuring the performance.
  • the method call matching unit 108 sets information that indicates a method that matches a predetermined condition in order to set a method that matches a predetermined condition as a next measurement target among methods called directly by the initial method or the performance difference factor method. Are stored in the target method table 113.
  • the initial method is a method that is called first in each thread during the period when the first program 120 or the second program 121 is being tested.
  • the performance difference factor method is a method that causes the difference in performance most when there is a difference in performance between the first program 120 and the second program 121.
  • the performance difference factor method determination unit 109 calculates a value indicating performance based on the difference between the method start time and the method end time stored in the first execution information table 114 and the second execution information table 115. Then, the calculated value is stored in the measurement result table 116.
  • the performance difference factor method determination unit 109 calculates the average execution time and the number of executions of the measurement target method in the first program 120 and the second program 121 as the first execution information table 114 and the second execution information table 115. Extract from Then, based on the extracted value, an execution time difference and an execution time ratio between the first program 120 and the second program 121 are calculated. The calculated value is stored in the measurement result table 116. Further, a performance difference factor method is extracted based on the execution time difference and the execution time ratio output to the measurement result table 116.
  • the measurement target method is a method whose performance is measured in the present embodiment.
  • the version switching unit 110 activates the program designated by the control unit 106 out of the first program 120 and the second program 121 to make the first program 120 or the second program 121 executable.
  • the first program 120 and the second program 121 are programs whose performance is measured by the computer 100 according to the first embodiment.
  • the first program 120 is a program before correction by the user
  • the second program 121 is a program after correction by the user.
  • the first program 120 and the second program 121 of this embodiment are programs created by Java or the like, and are executed in the Java VM (on the virtual machine) 122.
  • the Java VM 122 has a profile function for issuing a callback when a method called by the first program 120 and the second program 121 is started and ended.
  • the JVMTI 123 is a profile function for issuing a callback provided in the Java VM 122 of the present embodiment.
  • first program 120 and the second program 121 of the present invention are not limited to programs created in the Java language, but methods (or subroutines corresponding to methods) called by the first program 120 and the second program 121. ) May be created in any language as long as it includes a means for issuing a callback (or a signal corresponding to the callback) at the time of starting and ending.
  • the Java VM 122 and the JVMTI 123 may be any environment as long as it is an environment for executing the first program 120 and the second program 121 corresponding to the languages of the first program 120 and the second program 121.
  • the callback receiving unit 119 receives a callback issued by the JVMTI 123, and generates a time when the callback is received using a high-precision timer provided in the computer 100. Then, the generated time, information indicating the method included in the callback (class name, method name, method identifier, information indicating the calling method, frame number of the call stack, etc.) and the method are started. Information indicating whether or not the process has been completed is transmitted to the initial method recording unit 117 or the target method recording unit 118.
  • the initial method recording unit 117 is in a state where values are input to the first program 120 and the second program 121 by the test execution unit 107 (that is, while the first program 120 or the second program 121 is being tested). Extracts the highest method stored in the call stack. Then, information indicating the extracted method is stored in the first method call table 111 and the second method call table 112, respectively.
  • the method called by the first program 120 or the second program 121 is stored in the call stack for each thread and started. Then, the latest method stored in the call stack (PUSH) is acquired from the call stack earliest (POP). That is, the latest started method finishes earliest.
  • PUSH latest method stored in the call stack
  • POP call stack earliest
  • the method stored earliest in the call stack is described as the highest method, and the method stored later than the highest method in the call stack is described as a lower method.
  • the target method recording unit 118 is during the time when a value is input to the first program 120 or the second program 121 by the test execution unit 107 (that is, while the first program 120 or the second program 121 is being tested).
  • the start time and end time of the measurement target method stored in the target method table 113 and information indicating the method are received from the callback receiving unit 119.
  • Information such as the time received from the callback receiver 119 is stored in the first execution information table 114 or the second execution information table 115.
  • the target method recording unit 118 extracts information indicating a method directly called by the measurement target method while measuring the first program 120 or the second program 121. Then, information indicating the extracted method is stored in the first method call table 111 or the second method call table 112.
  • the first method call table 111 is a table in which information indicating a method called by the first program 120 is stored.
  • the second method call table 112 is a table in which information indicating a method called by the second program 121 is stored.
  • the target method table 113 is a table in which information indicating methods common to the first program 120 and the second program 121 among methods called by the first program 120 and the second program 121 is stored.
  • the first execution information table 114 is a table in which the start time and end time of the method called by the first program 120 are stored.
  • the second execution information table 115 is a table in which the start time and end time of the method called by the second program 121 are stored.
  • the measurement result table 116 includes the first program 120 and the second program 121 calculated based on the start time and end time of each method stored in the first execution information table 114 and the second execution information table 115. It is a table in which the value for comparing performance is stored.
  • FIG. 2 is an explanatory diagram illustrating the target method table 113 according to the first embodiment of this invention.
  • the target method table 113 stores information indicating a method whose start time and end time are measured.
  • the value stored in the target method table 113 is updated when a method called by the first program 120 or the second program 121 calls another method. That is, the target method table 113 is updated in order to set the method called by the measurement target method as the next measurement target method.
  • the target method table 113 includes a frame number 1131, method information 1132, and caller method information 1133.
  • the frame number 1131 is a number indicating the order of methods stored in the call stack. A smaller frame number 1131 indicates a higher method in the call stack.
  • the method information 1132 includes information indicating the measurement target method.
  • the value stored in the method information 1132 is an identifier that uniquely indicates the measurement target method, including the class name and method name of the measurement target method.
  • the caller method information 1133 includes information indicating a method that called the measurement target method indicated in the method information 1132.
  • the value stored in the caller method information 1133 has the same notation method as the value stored in the method information 1132. That is, the value stored in the caller method information 1133 is an identifier that uniquely indicates the caller method, including the class name and method name of the caller method.
  • FIG. 3A is an explanatory diagram illustrating the first method call table 111 according to the first embodiment of this invention.
  • the first method call table 111 stores information indicating a method called by the first program 120 when the first program 120 is measured.
  • the first method call table 111 includes a frame number 1111, method information 1112, and call source method information 1113.
  • the frame number 1111, the method information 1112, and the call source method information 1113 correspond to the frame number 1131, the method information 1132, and the call source method information 1133 in the target method table 113.
  • the method information 1112 of the first method call table 111 includes information indicating the method directly called by the initial method. Accumulated by the unit 118. Further, while the start time and end time of the measurement target method lower than the initial method are being measured, the method information 1112 of the first method call table 111 includes information indicating a method directly called by the measurement target method. Accumulated by the method recording unit 118.
  • FIG. 3B is an explanatory diagram illustrating the second method call table 112 according to the first embodiment of this invention.
  • the second method call table 112 stores information indicating a method called by the second program 121 when the second program 121 is measured.
  • the second method call table 112 includes a frame number 1121, method information 1122, and call source method information 1123.
  • the frame number 1121, method information 1122, and call source method information 1123 correspond to the frame number 1131, method information 1132, and call source method information 1133 in the target method table 113.
  • the information stored in the second method call table 112 is the same as the information stored in the first method call table 111, and a value extracted by executing the second program 121 is stored.
  • FIG. 4A is an explanatory diagram illustrating the first execution information table 114 according to the first embodiment of this invention.
  • the first execution information table 114 is a table that stores a start time or an end time of a method called by the first program 120.
  • the first execution information table 114 includes a frame number 1141, method information 1142, start / end information 1143, and time 1144.
  • the frame number 1141 and the method information 1142 correspond to the frame number 1131 and the method information 1132 of the target method table 113.
  • the value stored in the start / end information 1143 is “start” when the time 1144 included in each row indicates the start time of the method indicated by the method information 1142, and the time 1144 included in each row is indicated by the method information 1132. “End” indicates the end time of the method.
  • the time 1144 indicates the start time or end time of the method indicated by the method information 1142. Although the time 1144 shown in FIG. 4A is expressed by the system time used in the computer 100, the time may be indicated by any notation method.
  • FIG. 4B is an explanatory diagram illustrating the second execution information table 115 according to the first embodiment of this invention.
  • the second execution information table 115 is a table for storing the start time or end time of the method called by the second program 121.
  • the information stored in the second execution information table 115 is the same information as the first execution information table 114, and stores the value extracted by executing the second program 121.
  • the method to be measured by the computer 100 is the next measurement.
  • each table may be updated, and the frame number of each table may be updated. That is, the frame numbers included in the first method call table 111, the second method call table 112, the target method table 113, the first execution information table 114, and the second execution information table 115 all have the same value at the time of each measurement. May show.
  • each table may store the value by any method.
  • the frame number indicating the measurement target method is held by a variable
  • the measurement target method having the frame number indicated by the variable is A method of causing the computer 100 to measure may be used.
  • FIG. 5 is an explanatory diagram illustrating the measurement result table 116 according to the first embodiment of this invention.
  • the measurement result table 116 is a table that stores, for each method, values calculated based on the start time and end time included in the first execution information table 114 and the second execution information table 115.
  • the measurement result table 116 includes frame number 1161, method information 1162, average execution time 11631 and execution count 11632 of the first program, average execution time 11641 and execution count 11642 of the second program, execution time difference 1165, and execution time ratio 1166. including.
  • the frame number 1161 is a number indicating the order of methods stored in the call stack. Since a row of the measurement result table 116 is added every time a method is measured, the frame number 1161 indicates at least one value.
  • the method information 1162 stores information indicating the measured method.
  • the average execution time 11631 of the first program is an average value of the execution times of each method called multiple times when each method is called multiple times from the calling method.
  • the first execution time is calculated by extracting the method included in the method information 1142 of the first execution information table 114 and subtracting the start time from the end time of each extracted method. Then, a method indicating the same method as the extracted method is further extracted from the method information 1142, and the second execution time is calculated by calculating the execution time of the extracted method.
  • the average execution time 11631 is calculated by calculating the average value of the execution times calculated in this way.
  • the number of executions 11632 of the first program indicates the number of calls from the caller method.
  • the number of methods including both start and end in the start / end information 1153 is obtained by calculating how many methods are included in the first execution information table 114.
  • the average execution time 11641 of the second program and the execution count 11642 of the second program store the same values as the average execution time 11631 and the execution count 11632 of the first program, and are calculated based on the second execution information table 115. Stored value.
  • the execution time difference 1165 is calculated by calculating the total execution time of the method indicated by the method information 1162 in each of the first program 120 and the second program 121 every time the caller method is executed once. Indicates the difference. Specifically, based on the results of the first program 120 and the second program 121, the total execution time during which the method indicated by the method information 1162 is executed is calculated. Then, the total execution time is divided by the number of times the caller method is executed (corresponding to the execution number 11632 indicated by the caller method).
  • the values calculated by the above-described method are generated for the first program 120 and the second program 121.
  • the execution time difference 1165 is calculated by subtracting the value calculated by the second program 121 from the value calculated by the first program 120.
  • the present invention can calculate the difference in method execution time each time the caller method is executed by the execution time difference 1165.
  • a method for calculating the execution time difference 1165 of the method information 1162 “aaa.bbb.MyClass.start (int)” shown in FIG. FIG. 5 shows that the method “aaa.bbb.MyClass.start (int)” is executed by being called from “aaa.bbb.Starter.doStart ()”.
  • the number of times called by the calling method of the method “aaa.bbb.MyClass.start (int)” is 25, as indicated by the number of executions 11632 in FIG.
  • the number of executions 11642 in the second program of the method “aaa.bbb.MyClass.start (int)” and the method “aaa.bbb.Starter.doStart ()” is the number of executions 11632 in the first program. Is the same.
  • the execution time difference 1165 is calculated by the above-described equation.
  • the execution time ratio 1166 calculates the difference between the execution time per method indicated by the method information 1162 between the first program and the second program, and averages the calculated values. And it is a value calculated by dividing the averaged value by the average execution time 11631 of the first program.
  • the execution time ratio 1166 is a ratio of execution time differences between the old and new methods each time the method is executed once.
  • the present invention can calculate the rate of change of the execution time of each method based on the execution time ratio 1166.
  • the execution time ratio 1166 is a value obtained by dividing the value indicated by the execution time difference 1165 by the number of times the method indicated by the method information 1162 is executed each time the call source method is executed once. It is a value divided by the average execution time 11631 of the program.
  • the execution time difference 1165 and the execution time ratio 1166 of the initial method are calculated by assuming that the number of executions of the caller method (that is, the first program or the second program) is 1.
  • FIG. 6 is an explanatory diagram showing a screen 130 when the measurement result of the first embodiment of the present invention is displayed.
  • the screen 130 is a screen for providing the user with the result measured by the present embodiment via the output device 104.
  • the screen 130 includes a display 131, a display 132, and a display 133.
  • the display 131 shows a method name that is a performance difference factor method and a reason that it is a performance difference factor method.
  • the display 131 shown in FIG. 6 shows that the number of times that “aaa.bbb.MyClass.start (int)”, which is the calling method, calls “java.util.Map.get (Object)” is increased.
  • the program 120 is called 200 times, and the second program 121 is called 210 times.
  • the number of times the calling source method calls the method is the number of executions of the called method (the number of executions 11632 of the first program or the number of executions 11642 of the second program in the measurement result table 116). It is calculated by dividing by the number of executions 11632 of the first program or the number of executions 11642 of the second program in the measurement result table 116.
  • the display 132 is a display showing the method called by the hierarchical structure before the performance difference factor method is called. That is, the result of tracing the call stack including the performance difference factor method is shown.
  • the display 132 shows each method of the call stack including the performance difference factor method and the performance difference between the first program 120 and the second program 121 in each method.
  • the display 133 displays information including the measurement result table 116.
  • the display 133 illustrated in FIG. 6 includes information of the measurement result table 116 and caller method information 1133 of the target method table 113.
  • FIG. 7 is a flowchart showing the overall processing of the first embodiment of the present invention.
  • the control unit 106 extracts initial methods of the first program 120 and the second program 121, and among the extracted initial methods, a method common to the first program 120 and the second program 121 is stored in the target method table 113.
  • the target method table 113 stores a method common to the first program 120 and the second program 121 in the target method table 113, thereby measuring the method (measurement target method) for measuring the start time and the end time as the target method.
  • the table 113 140.
  • control unit 106 measures the execution time of the measurement target method stored in the target method table 113 (150). After step 150, the control unit 106 extracts a performance difference factor method based on the measurement result of step 150 (160).
  • control unit 106 determines whether or not a performance difference factor method has been extracted in Step 160 (170). When the performance difference factor method is not extracted, there is no performance difference between the first program 120 and the second program 121, so the control unit 106 ends the process.
  • the control unit 106 stores the method directly called by the performance difference factor method in the target method table 113, and further measures the method directly called by the performance difference factor method (180). ). This is because the method in which the performance difference is most noticeable is extracted from the methods directly called by the performance difference factor method.
  • step 180 the control unit 106 returns to step 150. Thereafter, when it is determined in step 170 that the performance difference factor method is not extracted, the control unit 106 terminates the process to indicate that the performance difference is the greatest in the caller method that called the measurement target method. To do.
  • FIG. 8 is a sequence diagram showing an initial method according to the first embodiment of this invention.
  • the sequence diagram shown in FIG. 8 shows the execution times of thread A 1071, thread B 1072, thread 1073, thread D 1074, and method 201 to method 216.
  • step 140 is during the test execution time from when the test execution unit 107 starts to input specific input values to the first program 120 and the second program 121 until when the specific input values have been input.
  • the call stack of each thread included in the first program 120 and the second program 121 it is a process of extracting the method stored at the highest level.
  • the program 200 is executed from the time when the test execution unit 107 starts to input a specific input value to the first program 120 or the second program 121 to the time when the input of the specific input value is finished.
  • the program 120 or the second program 121 is shown.
  • the program 200 calls the method 201 executed in the thread A 1071.
  • a method 201 called by the program 200 is a method that is always executed, and is a method that is being executed before the program 200 is started. For this reason, the method 201 is not an initial method in the thread A 1071 because it is not a method that causes a difference in performance.
  • the method 201 calls the method 203 executed in the thread B1072.
  • a method 203 called by the method 201 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 203 is an initial method in the thread B1072.
  • the method 203 is stored at the top of the call stack in the thread B 1072.
  • the method 202 and the method 209 in the thread B are not methods executed while the program 200 is executed, and are not initial methods because they do not cause a difference in performance.
  • the method 203 calls the method 204 and the method 205 while the method 203 is being executed.
  • a method 204 and a method 205 called by the method 203 are methods that are executed after the program 200 is started and ended before the program 200 ends. Therefore, the method 204 and the method 205 are methods that may become measurement target methods.
  • the frame numbers of the method 204 and the method 205 are “2”.
  • the method 205 calls a method 206 and a method 207.
  • the frame number of the method 203 is “1”
  • the frame number in the call stack of the method 206 and the method 207 is “3”.
  • method 207 calls method 208.
  • the frame number of the method 203 is “1”
  • the frame number of the method 208 in the call stack is “4”.
  • a method 204, a method 205, a method 206, a method 207, and a method 208 are methods that are executed after the program 200 starts and end before the program 200 ends. Therefore, the method 204, the method 205, the method 206, the method 207, and the method 208 are methods that may become measurement target methods.
  • Method 204 calls method 210 in thread C1073.
  • a method 210 called by the method 204 is a method that is executed even after the program 200 ends. For this reason, the method 210 does not cause a difference in performance, and thus is not an initial method in the thread C1073.
  • Method 210 calls method 211.
  • a method 211 called by the method 210 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 211 is an initial method in the thread C1073.
  • the method 211 is stored above the call stack in the thread C1073. At this time, since the method 210 has already been stored in the call stack of the thread C1073, the frame number of the method 211 is “2”.
  • method 211 calls method 212.
  • the frame number in the call stack of the method 212 is “3”.
  • a method 212 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 212 is a method that may be a measurement target method.
  • Method 211 calls method 214 in thread D1074.
  • a method 214 called by a method 211 is a method that is being executed before the program 200 is started. For this reason, the method 214 does not cause a difference in performance, and thus is not an initial method in the thread D1074.
  • Method 214 calls method 216.
  • a method 216 called by the method 214 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 216 is an initial method.
  • the frame number of the method 216 is “3”.
  • the method 215 of the thread D 1074 is a method that is executed after the method 216 and the method 214 are finished, and is finished before the program 200 is finished. For this reason, it becomes a factor that causes a difference in performance, and thus becomes an initial method.
  • the frame number of the method 216 is “2”.
  • control unit 106 of the present embodiment extracts the initial method described above in step 140.
  • FIG. 9 is a block diagram illustrating a data flow in the process of extracting the initial method according to the first embodiment of this invention.
  • the arrows shown in FIG. 9 indicate the data flow in step 140 shown in FIG. 7, and correspond to the processing shown in FIGS. 10A, 10B, and 10C.
  • FIG. 10A is a flowchart showing a process for executing a test to extract an initial method according to the first embodiment of this invention.
  • the process shown in FIG. 10A is a process included in step 140 shown in FIG. First, after receiving an instruction from the control unit 106 to set the first program 120 in a testable state, the version switching unit 110 switches the first program 120 to a state in which the first program 120 can be executed. 106 is notified (1401).
  • control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the initial method recording unit 117.
  • the initial method recording unit 117 stores “TRUE” in the test execution flag (1402). Note that the initial method recording unit 117 holds an area indicating the test execution flag in the memory 102 in advance.
  • test execution flag When “TRUE” is stored in the test execution flag, the test execution flag indicates that the test execution unit 107 is testing the program. When “FALSE” is stored in the test execution flag, the test execution flag indicates that the test execution unit 107 has not tested the program.
  • the control unit 106 transmits an instruction to start the test of the first program 120 to the test execution unit 107.
  • the test execution unit 107 receives an instruction to start the test of the first program 120 from the control unit 106, the test execution unit 107 starts the test of the first program 120 (1403).
  • the test execution unit 107 inputs a predetermined input value designated in advance by the user to the first program 120 in order to execute the test (1404). After step 1404, the test execution unit 107 ends the test of the first program 120, and then notifies the control unit 106 of the end of the test (1405).
  • control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the initial method recording unit 117.
  • the initial method recording unit 117 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1406).
  • control unit 106 transmits an instruction to end the first program 120 to the version switching unit 110 (1407).
  • the initial method recording unit 117 extracts a method to which a completed flag is added from a call stack for each thread (hereinafter referred to as a method information stack). Information indicating the extracted method is stored in the first method call table 111 (1409).
  • the completed flag is a storage area that is updated in the process shown in FIG.
  • the initial method recording unit 117 repeats Step 1409 for the method information stack of all threads (1408).
  • step 1408 the version switching unit 110 receives an instruction from the control unit 106 to make the second program 121 ready for testing. Thereafter, the version switching unit 110 switches the second program 121 to an executable state, and then notifies the control unit 106 of the end of the switching (1410).
  • control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the initial method recording unit 117.
  • the initial method recording unit 117 stores an instruction to store “TRUE” in the test execution flag from the control unit 106, and then stores “TRUE” in the test execution flag (1411).
  • the control unit 106 transmits an instruction to start the test of the second program 121 to the test execution unit 107.
  • the test execution unit 107 receives an instruction to start the test of the second program 121 from the control unit 106, the test execution unit 107 starts the test of the second program 121 (1412).
  • the test execution unit 107 inputs a predetermined value designated in advance by the user to the second program 121 in order to execute the test (1413). After step 1413, the test execution unit 107 ends the test of the second program 121, and then notifies the control unit 106 of the end of the test (1414).
  • control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the initial method recording unit 117.
  • the initial method recording unit 117 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1415).
  • control unit 106 transmits an instruction to end the second program 121 to the version switching unit 110 (1416).
  • the initial method recording unit 117 extracts the method for which the corresponding completed flag is generated from the method information stack for each thread, and indicates the extracted method.
  • the information is stored in the first method call table 111 (1418).
  • Step 1418 for the method information stack of all threads (1417).
  • control unit 106 extracts a measurement target method (1419), and ends the process illustrated in FIG. 10A.
  • FIG. 10B is a flowchart showing a process of extracting a measurement target method according to the first embodiment of this invention.
  • the process shown in FIG. 10B corresponds to step 1419 shown in FIG. 10A.
  • the control unit 106 transmits an instruction to extract the measurement target method to the method call matching unit 108 after step 1417 in FIG. 10A is completed (1420).
  • the method call matching unit 108 After receiving the instruction to extract the measurement target method from the method call matching unit 108, the method call matching unit 108 reads information stored in the first method call table 111 (1421). Further, the method call matching unit 108 reads information stored in the second method call table 112 (1422).
  • the method call matching unit 108 deletes the data stored in the target method table 113 in order to store the new measurement target method in the target method table 113 (1423).
  • the method call verification unit 108 is common to the first method call table 111 and the second method call table 112 based on the information read from the first method call table 111 and the second method call table 112. The extracted method is extracted, and the extracted method is stored in the target method table 113 (1424).
  • step 1424 the method call matching unit 108 notifies the control unit of the end of extraction of the measurement target method, and ends the process of step 1419 (1425).
  • step 1419 the methods stored in common in the first method call table 111 and the second method call table 112 are extracted as measurement target methods.
  • FIG. 10C is a flowchart showing processing for extracting an initial method according to the first embodiment of this invention.
  • the process shown in FIG. 10C is a process for extracting an initial method from methods called by each program during the execution of the test shown in FIG. 10A.
  • the callback receiving unit 119 receives the callback from the JVMTI 123, and transmits the time when the callback is received and each information included in the callback to the initial method recording unit 117.
  • the callback includes information indicating the method (class name, method name, method identifier, information indicating the calling method, frame number in the call stack, etc.), and whether the method has started or ended. Is included.
  • the initial method recording unit 117 determines whether “TRUE” is stored in the test execution flag (1431). If “FALSE” is stored in the test execution flag, the test has not been executed and it is not necessary to extract the initial method, so the initial method recording unit 117 proceeds to step 1438.
  • the initial method recording unit 117 determines whether the method is started or ended based on the information included in the received callback (1432).
  • step 1433 the method stored in the method information stack becomes an initial method candidate.
  • the initial method recording unit 117 determines whether or not the method information included in the callback is already stored in any of the method information stacks ( 1434).
  • the determination in step 1434 can determine whether or not the method indicated by the callback is a method started while the test is being executed. As described above, the initial method is a method that is started and ended while the test is being executed.
  • step 1434 If it is determined in step 1434 that the method information included in the callback is not stored in any of the method information stacks, the method indicated by the callback is not started while the test is being executed. Since it is a method and not an initial method, the initial method recording unit 117 proceeds to Step 1439.
  • step 1434 If it is determined in step 1434 that the method information included in the callback is stored in any of the method information stacks, the method indicated by the callback is started while the test is being executed. It is a method that can be an initial method. Therefore, the initial method recording unit 117 proceeds to step 1435 after step 1434.
  • the initial method recording unit 117 obtains the method stored at the lowest level of the method information stack determined in step 1434 that the method information included in the callback is stored (POP). Then, information indicating the acquired method is stored in the first method information (1435).
  • the first method information is a storage area for temporarily storing information indicating a method, and is held in advance by the initial method recording unit 117.
  • the initial method recording unit 117 determines whether or not the top method information is the same as the information indicating the method included in the callback (1436).
  • the method stored in the head method information is a lower-level method than the method included in the callback. Therefore, the initial method recording unit 117 returns to step 1435 in order to store a higher-order method in the top method information.
  • step 1436 when the head method information is the same as the information indicating the method included in the callback, the initial method recording unit 117 generates a completed flag corresponding to the head method information (1437).
  • the completed flag is generated correspondingly, the method indicated by the first method information indicates that it has been completed.
  • the initial method recording unit 117 stores (PUSH) again the method information stored in the head method information in the method information stack acquired in step 1435 (1438).
  • the finished method is stored at the lowest position in the method information stack. Also, the process shown in FIG. 10C is executed each time a callback is issued, so that the highest method among the methods started and ended during the test execution remains in the method information stack. For this reason, after the test is finished, the method that is stored in the method information stack and the corresponding finished flag is generated is the initial method.
  • the initial method recording unit 117 ends the process of FIG. 10C and notifies the callback receiving unit 119 of the end of the process (1439).
  • the initial method recording unit 117 After the initial method is stored in the method information stack by the process shown in FIG. 10C, the initial method recording unit 117 generates a completed flag in the method information stack for each thread in steps 1409 and 1418 shown in FIG. 10A.
  • the stored method is stored in the first method call table 111 or the second method call table 112. As a result, the initial method is stored in the first method call table 111 and the second method call table 112.
  • FIG. 11 is a block diagram illustrating a data flow in the process of measuring the execution time of the measurement target method according to the first embodiment of this invention.
  • the arrows shown in FIG. 11 indicate the data flow in step 150 shown in FIG. 7, and correspond to the processing shown in FIGS. 12A and 12B.
  • FIG. 12A is a flowchart illustrating a process for executing a test to measure the execution time according to the first embodiment of this invention.
  • the process shown in FIG. 12A is a process included in step 150 shown in FIG. First, after receiving an instruction from the control unit 106 to set the first program 120 in a testable state, the version switching unit 110 switches the first program 120 to a state in which the first program 120 can be executed. 106 is notified (1501).
  • control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the target method recording unit 118.
  • the target method recording unit 118 receives an instruction to store “TRUE” in the test execution flag from the control unit 106, and then stores “TRUE” in the test execution flag (1502).
  • the target method recording unit 118 holds an area indicating the test execution flag in the memory 102 in advance.
  • the test execution flag held by the initial method recording unit 117 and the test execution flag held by the target method recording unit 118 may be stored in the same area.
  • the control unit 106 transmits an instruction to start the test of the first program 120 to the test execution unit 107.
  • the test execution unit 107 receives an instruction to start the test of the first program 120 from the control unit 106, the test execution unit 107 starts the test of the first program 120 (1503).
  • the test execution unit 107 inputs a predetermined value designated in advance by the user to the first program 120 in order to execute the test (1504). After step 1504, the test execution unit 107 ends the test of the first program 120, and then notifies the control unit 106 of the end of the test (1505).
  • control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the target method recording unit 118.
  • the target method recording unit 118 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1506).
  • control unit 106 transmits an instruction to end the first program 120 to the version switching unit 110 (1507).
  • the version switching unit 110 receives an instruction from the control unit 106 to make the second program 121 ready for testing. Thereafter, the version switching unit 110 switches the second program 121 to an executable state, and then notifies the control unit 106 of the end of the switching (1508).
  • control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the target method recording unit 118.
  • the target method recording unit 118 receives an instruction to store “TRUE” in the test execution flag from the control unit 106, and then stores “TRUE” in the test execution flag (1509).
  • the control unit 106 transmits an instruction to start the test of the second program 121 to the test execution unit 107.
  • the test execution unit 107 receives an instruction to start the test of the second program 121 from the control unit 106, the test execution unit 107 starts the test of the second program 121 (1510).
  • the test execution unit 107 inputs a predetermined value designated in advance by the user to the second program 121 in order to execute the test (1511). After step 1511, the test execution unit 107 ends the test of the second program 121, and then notifies the control unit 106 of the end of the test (1512).
  • control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the target method recording unit 118.
  • the target method recording unit 118 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1513).
  • control unit 106 transmits an instruction to end the second program 121 to the version switching unit 110 (1514), and ends the process illustrated in FIG. 12A.
  • FIG. 12B is a flowchart illustrating processing for measuring the execution time of the measurement target method according to the first embodiment of this invention.
  • the process shown in FIG. 12B shows the process of measuring the execution time of the measurement target method when the first program 120 is executed.
  • the process for measuring the execution time of the measurement target method when the second program 121 is executed is performed by changing the first program 120 to the second program 121 included in the process shown in FIG. This is a process in which the table 111 is changed to the second method call table 112 and the first execution information table 114 is changed to the second execution information table 115.
  • the callback receiving unit 119 receives a callback from the JVMTI 123 during execution of the test of the first program 120, and records the time when the callback is received and each piece of information included in the callback as the target method recording unit 118. (1514).
  • the target method recording unit 118 determines whether “TRUE” is stored in the test execution flag (1515). When “FALSE” is stored in the test execution flag, since the test is not executed and the execution time cannot be measured, the target method recording unit 118 proceeds to step 1526 and the callback reception unit 119 performs processing. Notify the end.
  • Information indicating which of the first program 120 or the second program 121 is being tested may be added to the test execution flag, and the target method recording unit 118 refers to the test execution flag. Thus, it may be determined whether processing is performed using the first execution information table 114 and the first method call table 111 or processing is performed using the second execution information table 115 and the second method call table 112.
  • the target method recording unit 118 determines whether “FALSE” is stored in the method execution flag of the thread in which the method indicated by the callback is executed. (1516).
  • the method executing flag is a storage area that is held in advance by the target method recording unit 118.
  • FALSE When “FALSE” is stored in the method execution flag of a thread, it indicates that the measurement target method is not executed in the thread.
  • TRUE When “TRUE” is stored in the method execution flag of a thread, Indicates that the measurement target method is being executed in the thread.
  • the method executing flag is updated in step 1519 and step 1522 described later.
  • the target method recording unit 118 may acquire the thread in which the method is executed from information indicating the method included in the callback.
  • step 1516 If it is determined in step 1516 that “FALSE” is stored in the method execution flag of the thread in which the method is executed, the callback received in step 1514 indicates the start of the method, so that the target method recording unit 118 moves to step 1517 to store the start time.
  • the target method recording unit 118 determines whether or not the method indicated by the callback is stored in the target method table 113 (1517). If the method indicated by the callback is not stored in the target method table 113, the target method recording unit 118 proceeds to step 1526 because the method indicated by the callback is not a measurement target method.
  • step 1517 If it is determined in step 1517 that the method indicated by the callback is stored in the target method table 113, the target method recording unit 118 is included in the callback because the method indicated by the callback is the measurement target method.
  • Information indicating the method and the time included in the callback (that is, the start time of the method) are stored in the first execution information table 114 (1518).
  • the target method recording unit 118 stores “TRUE” in the method execution flag of the thread in which the method indicated by the callback is executed. Further, the target method recording unit 118 stores the frame number in the call stack of the method included in the callback in the measurement target frame of the thread in which the method is executed (1519).
  • the measurement target frame is a storage area for temporarily storing the frame number held by the target method recording unit 118.
  • the value stored in the measurement target frame indicates the frame number of the measurement target method and is held for each thread.
  • step 1519 the target method recording unit 118 proceeds to step 1526 and notifies the callback receiving unit 119 of the end of processing.
  • step 1516 If it is determined in step 1516 that “TRUE” is stored in the method execution flag of the thread in which the method indicated by the callback is executed, the callback received in step 1514 indicates the end of the method.
  • the target method recording unit 118 proceeds to Step 1520 to store the end time.
  • the target method recording unit 118 determines whether the number stored in the measurement target frame of the thread in which the method indicated by the callback is executed is the same as the frame number of the method indicated by the callback ( 1520).
  • the method indicated by the callback is the method that is started during the execution of the test and the start time is stored in step 1518. . Therefore, the target method recording unit 118 proceeds to Step 1521.
  • the target method recording unit 118 stores information indicating the method included in the callback and the time included in the callback (that is, the end time of the method) in the first execution information table 114 (1521). ). After step 1521, the target method recording unit 118 stores “FALSE” in the method executing flag (1522).
  • step 1522 the target method recording unit 118 proceeds to step 1526 and notifies the callback receiving unit 119 of the end of processing.
  • step 1520 when the number stored in the measurement target frame of the thread in which the method indicated by the callback is executed is different from the frame number of the method indicated by the callback, the method indicated by the callback is not yet completed. A method called by a target method or a method further called from a method called by a measurement target method. Therefore, the target method recording unit 118 proceeds to Step 1523.
  • the target method recording unit 118 determines whether or not the value stored in the measurement target frame is a value obtained by subtracting 1 from the frame number of the method indicated by the callback. That is, it is determined whether or not the method indicated by the callback is a method directly called by the measurement target method (1523).
  • the target method recording unit 118 determines whether or not the callback indicates the start of the method ( 1524). If the callback does not indicate the start of the method but indicates the end in step 1524, the target method recording unit 118 proceeds to step 1626.
  • step 1524 when the callback indicates the start of the method, the method indicated by the callback is the next measurement target method. Therefore, the target method recording unit 118 stores information indicating the method included in the callback as the first method. Store in the call table 111 (1525).
  • the values stored in the first method call table 111 and the second method call table 112 may be deleted before the test shown in FIG. 12A is executed. That is, the first method call table 111 and the second method are stored in the first method call table 111 and the second method call table 112 by the step 1525 so that only methods that may become the next measurement target methods are stored in the first method call table 111 and the second method call table 112.
  • the value indicating the previous initial method or measurement target method included in the call table 112 may be deleted at the start of the test illustrated in FIG. 12A.
  • Step 1526 the target method recording unit 118 proceeds to Step 1526.
  • step 1526 the callback receiver 119 waits until the next callback is received.
  • the target method recording unit 118 measures the execution time of the measurement target method and extracts the next measurement target method.
  • FIG. 13 is a flowchart showing processing for extracting a performance difference factor method according to the first embodiment of this invention.
  • step 160 shown in FIG. Step 160 is executed each time step 150, that is, the process shown in FIG. 12A is performed.
  • the control unit 106 transmits an instruction to extract the performance difference factor method to the performance difference factor method determination unit 109 (1601).
  • the performance difference factor method determination unit 109 receives an instruction to extract a performance difference factor method from the control unit 106, and then holds a temporary storage area in which the variable i and the maximum performance difference factor rate are stored in the memory 102. Then, 1 is stored in the variable i, and 0 is stored in the maximum performance difference factor rate (1602).
  • variable i is a pointer indicating the row of the target method table 113, and the maximum performance difference factor rate indicates the maximum value of the performance difference factor rate described later.
  • step 1602 the performance difference factor method determination unit 109 repeats the processing from step 1604 to step 1613 until the value stored in the variable i exceeds the number of rows in the target method table 113.
  • the performance difference factor method determination unit 109 calculates the average execution time 11631 and the number of executions 11632 of the measurement target method in the first program 120 based on the first execution information table 114.
  • the performance difference factor method determination unit 109 extracts one measurement target method from the target method table 113, and extracts a line in the output device 104 where the value of the method information 1142 indicates the measurement target method. Then, two consecutive lines whose start / end information 1143 indicates “start” and “end” are extracted from the extracted lines. Then, the number of executions 11632 is calculated by calculating the number of sets of two extracted rows.
  • the performance difference factor method determination unit 109 calculates a method execution time per time by calculating a difference between the times 1144 of the two extracted rows. Then, the average execution time 11631 is calculated by calculating the execution time of each of the two sets of extracted rows and calculating the average value of the execution times of all the sets.
  • the performance difference factor method determination unit 109 calculates the average execution time 11641 and the number of executions 11642 of the measurement target method in the second program 121 based on the second execution information table 115 (1605).
  • the specific calculation method of the average execution time 11641 and the execution count 11642 is the same as the calculation method of the average execution time 11631 and the execution count 11632, but the average execution time 11641 and the execution count 11642 are the same as those in the first execution information table 114. Instead, it is calculated based on the second execution information table 115.
  • the performance difference factor method determination unit 109 calculates an execution time difference 1165 and an execution time ratio 1166 (step 1606). Specifically, the performance difference factor method determination unit 109 calculates the total execution time of each group calculated in step 1604 from the value obtained by dividing the total execution time of each group calculated in step 1605 by the execution count 11632. Is subtracted by the number of executions 11642 to calculate the execution time difference 1165.
  • step 1606 the performance difference factor method determination unit 109 further divides the calculated execution time difference 1165 by the execution count 11632, and further divides the divided result by the average execution time 11631, thereby executing the execution time.
  • the ratio 1166 is calculated.
  • the performance difference factor method determination unit 109 calculates the average execution time 11631, the execution count 11632, the average execution time 11641, the execution count 11642, the execution time difference 1165, calculated in step 1604, step 1605, and step 1606.
  • the execution time ratio 1166 is stored in the measurement result table 116 (1607).
  • step 1604 to step 1607 may be performed for all methods included in the target method table 113.
  • the performance difference factor method determination unit 109 executes the method information 1162 of the measurement result table 116 corresponding to the method information 1132 in the row indicated by the variable i of the target method table 113, the execution time difference 1165, and the execution time ratio 1166. Are extracted (1608).
  • the performance difference factor method determination unit 109 determines whether or not the execution time ratio 1166 extracted in step 1608 is equal to or greater than the execution time ratio threshold specified in advance by the user (1609). If the execution time ratio 1166 is not equal to or greater than the execution time ratio threshold, the performance difference between the measurement target methods in the first program 120 and the second program 121 is in a range that is not problematic for the user. Control goes to step 1613.
  • the performance difference between the measurement target methods in the first program 120 and the second program 121 is in a range that causes a problem for the user. Shifts to step 1610.
  • the performance difference factor method determination unit 109 extracts the caller method information 1133 of the row indicated by the variable i from the target method table 113, and executes the method information 1162 corresponding to the extracted caller method information 1133.
  • the time difference 1165 is extracted from the measurement result table 116.
  • the performance difference factor method determination unit 109 stores the extracted execution time difference 1165 in the caller execution time difference (1610).
  • the caller execution time difference is a partial storage area in the memory 102 held by the performance difference factor method determination unit 109.
  • the performance difference factor method determination unit 109 divides the execution time difference 1165 extracted in step 1608 by the caller execution time difference. The divided result is stored in the performance difference factor rate (1611).
  • the performance difference factor rate is a partial storage area in the memory 102 held by the performance difference factor method determination unit 109.
  • the performance difference factor method determination unit 109 determines whether or not the value indicated by the maximum performance difference factor rate is greater than the value indicated by the performance difference factor rate calculated in step 1611 (1612). .
  • the maximum performance difference factor rate is a partial storage area in the memory 102 held by the performance difference factor method determination unit 109.
  • the maximum performance difference factor rate is the value of the performance difference factor rate showing the largest value among the performance difference factor rates calculated by executing Steps 1608 to 1611 in each row indicated by the variable i of the target method table 113. This is an area for storing values.
  • step 1612 if the value indicated by the maximum performance difference factor rate is not greater than the value indicated by the performance difference factor rate calculated in step 1611, the value indicated by the maximum performance difference factor rate is not changed.
  • the unit 109 proceeds to step 1613.
  • step 1612 when the value indicated by the maximum performance difference factor rate is greater than the value indicated by the performance difference factor rate calculated in step 1611, the performance difference factor method determination unit 109 determines that the performance difference factor calculated in step 1611 The maximum performance difference factor rate is updated according to the rate. Also, the performance difference factor method is updated with the value of the method information 1132 in the row of the target method table 113 indicated by the variable i (1613). Through the processing in step 1612 and step 1613, a performance difference factor method is extracted.
  • step 1609 the performance difference factor method determination unit 109 adds 1 to the value stored in the variable i. That is, one row of the target method table 113 for performing the processing shown in steps 1604 to 1613 is moved (1613).
  • the performance difference factor method determination unit 109 After performing the processing of step 1604 to step 1613 for all the rows of the target method table 113, the performance difference factor method determination unit 109 notifies the control unit 106 that the extraction process of the performance difference factor method has ended ( 1614).
  • the performance difference between the first program and the second program is compared by calculating the execution time ratio 1166, but the performance difference is determined by comparing the execution time difference 1165. May be compared. That is, when the number of calls from the caller method is constant, the performance difference may be compared by the execution time difference 1165.
  • step 160 shown in FIG. 7 After the process shown in FIG. 13, that is, step 160 shown in FIG. 7 is completed, if the value is stored in the performance difference factor method, the process shown in FIG. 14, that is, step 180 is executed.
  • FIG. 14 is a flowchart showing processing for setting the measurement target method again according to the first embodiment of this invention.
  • the process shown in FIG. 14 corresponds to the process shown in Step 180 of FIG.
  • control unit 106 transmits an instruction to set the measurement target method again to the method call matching unit 108 (1801).
  • step 1801 the method call verification unit 108 reads the first method call table 111 (1802) and reads the second method call table 112 (1803). Then, the value stored in the target method table 113 is deleted (1804).
  • the method information 1132 stored in step 1525 of FIG. 12B is held in the first method call table 111 and the second method call table 112. That is, information indicating a method that may become the next measurement target method is held.
  • the method call verification unit 108 calls the source method information (1113 and 1122) out of the method information (1112 and 1122) held in common in the first method call table 111 and the second method call table 112.
  • the method indicated by 1123) stores the method information (1112 and 1122) that is the performance difference factor method extracted by the processing shown in FIG. 13 in the target method table 113 (1805).
  • step 1805 the method call matching unit 108 notifies the control unit 106 of the end of resetting the measurement target method (1806).
  • step 150 After the process shown in FIG. 14, the process from step 150 to step 180 shown in FIG. 7 is repeated until no performance difference factor method is extracted.
  • the first embodiment for example, it is possible to compare the performance of a program to which a modification that affects performance is added and a program before the modification. Further, even when there is no significant difference between the execution time of the program before correction and the execution time of the program after correction, it is possible to extract a method having a significant difference in performance by comparing the execution times for each method.
  • the performance difference factor between the two user applications can be analyzed, and if the user application is fixed, the application server Can analyze the performance difference between different versions.
  • the method for measuring the execution time is extracted, the influence on the load due to the measurement of the execution time is reduced, and a method including a process having a problem in performance is detected with high accuracy. can do.
  • FIG. 15 is a block diagram illustrating a configuration of the computer 100 that analyzes a performance difference of a single program according to the second embodiment of this invention.
  • the computer 100 of the second embodiment executes a test of one program and measures the performance of one program. Then, the threshold specified in advance by the user is compared with the measured performance, and a performance difference factor method is extracted.
  • the computer 100 of the second embodiment includes the same memory 102, arithmetic device 101, external storage device 103, output device 104, and input device 105 as the computer 100 of the first embodiment.
  • the JVMTI 313 includes a control unit 106, a test execution unit 107, a method call matching unit 108, a performance difference factor method determination unit 109, a version switching unit 110, an initial method recording unit 117, and a target method recording unit according to the first embodiment.
  • 118, the callback receiver 119, the JavaVM 122, and the JVMTI 123 have the same functions.
  • the target method table 305 and the measurement result table 307 of the second embodiment include the same information as the target method table 113 and the measurement result table 116 of the first embodiment.
  • control unit 300 tests only one measurement target program 311, a method call table 304 corresponding to the first method call table 111 and an execution corresponding to the first execution information table 114 are performed. There is one information table 306 for each.
  • FIG. 16 is an explanatory diagram illustrating a method call table 304 according to the second embodiment of this invention.
  • the method call table 304 includes the same information as the first method call table 111 and the second method call table 112 of the first embodiment.
  • the frame number 3041, the method information 3042, and the caller method information 3043 are the same as those in the first embodiment. This corresponds to the frame number 1111, method information 1112, and caller method information 1113 of the form.
  • FIG. 17 is an explanatory diagram illustrating an execution information table 306 according to the second embodiment of this invention.
  • the execution information table 306 includes the same information as the first execution information table 114 and the second execution information table 115 of the first embodiment, and the frame number 3061, method information 3062, start / end information 3063, and time 3064 are the first information. Corresponds to the frame number 1141, method information 1142, start / end information 1143, and time 1144.
  • FIG. 18 is an explanatory diagram illustrating a measurement result table 307 according to the second embodiment of this invention.
  • the measurement result table 307 includes a frame number 3071, method information 3072, an average execution time 3073, and an execution count 3074.
  • the frame number 3071, the method information 3072, the average execution time 3073, and the execution count 3074 correspond to the frame number 1161, the method information 1162, the average execution time 11631, and the execution count 11632 in the measurement result table 116 of the first embodiment.
  • FIG. 19 is a flowchart showing the overall processing of the second embodiment of the present invention.
  • the control unit 300 first extracts the initial method of the measurement target program 311 and stores the extracted initial method in the target method table 305. As a result, the measurement target method is stored in the target method table 305 (320).
  • step 320 the control unit 300 executes the processing shown in FIGS. 10A to 10C only for the measurement target program 311. Specifically, the control unit 300 executes the test of the measurement target program 311 by causing the test execution unit 301 to execute steps 1402 to 1409 shown in FIG. 10A. When the process illustrated in FIG. 10A is executed, the control unit 300 causes the callback receiver 310 and the initial method recording unit 308 to execute the process illustrated in FIG.
  • step 320 the control unit 300 causes the method call matching unit 302 to execute steps 1421, 1423, and 1424 shown in FIG.
  • step 1424 the method call matching unit 302 stores all the method information 3042 included in the method call table in the target method table 305.
  • step 320 the control unit 300 measures the execution time of the measurement target method (330).
  • step 330 the control unit 300 executes the process shown in FIGS. 12A and 12B only for the measurement target program 311.
  • control unit 300 executes the test of the measurement target program 311 by causing the test execution unit 301 to execute steps 1502 to 1507 in step 330. Then, while the measurement target program 311 is being tested, the target method recording unit 309 executes the process shown in FIG.
  • control unit 300 extracts a method that satisfies a predetermined condition.
  • FIG. 20 is a flowchart showing a process of extracting a method that satisfies a predetermined condition according to the second embodiment of the present invention.
  • the process shown in FIG. 20 corresponds to step 340 shown in FIG.
  • the control unit 300 transmits an instruction to extract a method satisfying a predetermined condition to the performance difference factor method determination unit 303 (3401).
  • the performance difference factor method determination unit 303 holds the variable i in the memory 102 and stores 1 in the variable i (3402).
  • a variable i is a pointer indicating a row of the target method table 305.
  • step 3402 the performance difference factor method determination unit 303 repeats the processing from step 3403 to step 3408 until the value stored in the variable i exceeds the number of rows in the target method table 305 (3402).
  • the performance difference factor method determination unit 303 calculates the average execution time 3073 and the number of executions 3074 of the measurement target method based on the execution information table 306 (3403).
  • the calculation method of the average execution time 3073 and the execution count 3074 is the same as the calculation method of the average execution time 11631 and the execution count 11632 of the first embodiment.
  • the performance difference factor method determination unit 303 stores the calculated average execution time 3073 and execution count 3074 in the measurement result table 307 (3404).
  • the performance difference factor method determination unit 303 determines whether or not a value obtained by multiplying the average execution time 3073 and the number of executions 3074 is larger than a threshold value specified in advance by the user (3405). If the value obtained by multiplying the average execution time 3073 and the number of executions 3074 does not exceed the threshold value designated in advance by the user, there is no problem with the method indicated by the variable i. Transition.
  • step 3405 If it is determined in step 3405 that the value obtained by multiplying the average execution time 3073 and the number of executions 3074 is larger than the threshold value specified in advance by the user, there is a possibility that there is a problem in the method indicated by the variable i.
  • the difference factor method determination unit 303 proceeds to step 3406.
  • the performance difference factor method determination unit 303 determines whether the value obtained by multiplying the average execution time 3073 and the execution count 3074 is greater than the value obtained by multiplying the average execution time 3073 and the execution count 3074 of the maximum execution time method. It is determined (3407).
  • the maximum execution time method is a storage area held in the memory 102 by the performance difference factor method determination unit 303, and among the methods satisfying a predetermined condition, the method having the largest value obtained by multiplying the average execution time 3073 and the execution count 3074 This is an area for storing information indicating.
  • the performance difference factor method determination unit 303 proceeds to Step 3409. .
  • the maximum execution time method is updated by the method indicated by the variable i. (3408).
  • step 3406 After step 3406, step 3407, or step 3408, the performance difference factor method determination unit 303 adds 1 to the value stored in the variable i (3409). As a result, the performance difference factor method determination unit 303 can acquire the next row of the target method table 305.
  • the performance difference factor method determination unit 303 notifies the control unit 300 of the end of the process of extracting a method that satisfies a predetermined condition (3410).
  • the first method call table 111 and the first execution information table 114 are the method call table 304. And the target method recording unit 309.
  • the computer 100 can execute both the first embodiment and the second embodiment. That is, the user designates in advance whether to measure the performance of one program or to compare the performance of two programs, and the control unit 106 or the control unit 300 determines whether the first program is based on the designation from the user. You may choose to perform one embodiment or a second embodiment.
  • the initial method in the first embodiment and the second embodiment described above is automatically extracted by executing the program, it may be specified by the user.
  • FIG. 21 is an explanatory diagram showing a screen for designating an initial method according to the second embodiment of this invention.
  • a screen 400 shown in FIG. 21 is a screen for designating an initial method of the second embodiment, but may be used in the first embodiment.
  • the screen 400 is a screen that the control unit 300 (or the control unit 106) displays to the user via the output device 104.
  • the screen 400 includes a selection area 401, a selection area 402, and an instruction area 403.
  • the user designates information shown on the screen 400 by operating the screen 400 displayed on the output device 104 with the input device 105.
  • the selection area 401 includes a button for selecting a method for extracting an initial method.
  • the control unit 300 or the control unit 106 automatically extracts the initial method in step 320.
  • the control unit 300 or the control unit 106 does not execute step 320 (or 140), and the initial method specified by the user is selected as the target method table 305 (or the target method table 113). To store.
  • the selection area 402 includes a check box for designating an initial method when “manual” is selected in the selection area 401.
  • methods called by programs are displayed in a hierarchical structure. Each method displayed in the selection area 402 can be selected by a check box.
  • the control unit 300 (or the control unit 106) starts the process shown in FIG. 19 (or FIG. 7) based on the information specified on the screen 400.
  • a method (maximum execution time method) that affects performance can be automatically extracted in one program. Further, since the method for measuring the execution time is extracted as in the first embodiment, the maximum execution time method can be accurately extracted regardless of the scale of the program.
  • an initial method can be designated by the user, a part of a program whose execution time is desired to be measured can be measured in a limited manner. For example, when a part of a program is modified and it is not necessary to measure the performance of all programs, the user designates a method that first executes a part of the program whose performance is to be measured as an initial method. As a result, performance can be measured in a short time, and power consumption can be reduced.
  • the execution time and the number of executions of the caller method can be used as the determination condition for the predetermined condition, for example, a ratio with respect to the execution time of the caller method is compared with a predetermined threshold.
  • the performance difference factor method or the maximum execution time method may be extracted.
  • the present invention is applicable to a system that measures the performance of a program in an application server.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A performance measurement device repeatedly executes a procedure of initially determining at least one first method among methods which are directly called by a program for which performance is to be measured, and by executing the program, measuring execution time of each of the first methods, and then, using the execution time of each of the measured first methods, assessing whether or not at least one second method matching a predetermined condition can be extracted from each of the first methods, and if at least one second method can be extracted, assessing whether or not at least one third method which is directly called from each of the extracted second methods can be extracted, and if at least one third method can be extracted, determining the extracted third method as a first method, measuring the execution time thereof, assessing whether or not a second method can be extracted, assessing whether or not a third method can be extracted, and determining the third method as a first method.

Description

性能測定方法、性能測定装置、及び、性能測定プログラムPerformance measurement method, performance measurement apparatus, and performance measurement program
 本発明は、性能測定方法に関し、特に、プログラムの性能を測定する性能測定方法に関する。 The present invention relates to a performance measurement method, and more particularly to a performance measurement method for measuring the performance of a program.
 複数のメソッドを含むプログラムを用いてシステムを稼動させる場合、期待した処理性能によってシステムが稼動するか否かを判定するため、プログラムの開発者等は、プログラムに特定の入力をし、それに対するシステムの処理性能を測定する。そして、測定の結果、システムが期待した処理性能によって稼動しない場合、開発者等には、プログラムのうち、処理性能に問題がある箇所を特定する必要が生じる。 When a system is operated using a program including a plurality of methods, in order to determine whether or not the system is operated according to expected processing performance, a program developer or the like inputs a specific input to the program, and the system corresponding thereto Measure the processing performance. As a result of the measurement, if the system does not operate according to the expected processing performance, the developer or the like needs to specify a part of the program that has a problem with the processing performance.
 従来用いられる一般的な方法には、あらかじめプログラムに埋め込まれた機能を用いて、実行中のプログラムにログを出力させ、出力されたログによって、プログラムの全体の処理の開始から終了までの実行時刻を取得する方法などがある。しかし、このような方法は、荒い精度でしか実行時間を取得できなかった。 A general method that has been used in the past is to use a function embedded in the program in advance to output a log to the program being executed, and the output time from the start to the end of the entire processing of the program based on the output log There is a way to get it. However, such a method can acquire the execution time only with rough accuracy.
 また、従来の方法には、OS又は仮想マシンが備えるプロファイリング機能を用いて、個々のメソッドの実行時間を測定するプロファイラと呼ばれるツールを用いる方法がある。この方法によれば、プロファイラを用いることによって、より詳細な精度に、プログラムの実行性能を分析することができる。そして、プログラムを最適化したり、処理性能に問題があった場合に問題を解決することができる。 Further, as a conventional method, there is a method of using a tool called a profiler that measures an execution time of each method by using a profiling function provided in an OS or a virtual machine. According to this method, the execution performance of the program can be analyzed with more detailed accuracy by using the profiler. The problem can be solved when the program is optimized or there is a problem in the processing performance.
 しかし、一般的に、メソッドの個数はプログラムの規模にほぼ比例して増え、メソッドが実行される回数もプログラム全体の実行時間にほぼ比例して増える。このため、大規模なプログラム、及び、起動時間が長いプログラム(例えば、サーバを稼動させるためのプログラムなど)の処理性能を測定する場合、プログラムに含まれるメソッドが大量になるため、プロファイラによる個々のメソッドの実行時間を記録することは、困難であった。 However, in general, the number of methods increases almost in proportion to the scale of the program, and the number of times the method is executed increases in proportion to the execution time of the entire program. For this reason, when measuring the processing performance of a large-scale program and a program with a long startup time (for example, a program for operating a server), the method included in the program becomes large. It was difficult to record the execution time of a method.
 また、性能問題が発生した場合におけるボトルネックとなるメソッドの特定など、性能を測定したいメソッドが特定できていない場合、実行される全てのメソッドの実行時間を測定し、測定された結果を記録しておく必要がある。しかし、一般的にメソッドは、非常に短い時間の間隔で頻繁に呼び出されるため、頻繁に発生する実行時間の測定及び記録自体が、プログラムが稼動するシステムのリソースを消費した。このため、測定自体が性能に影響を及ぼし、正確な測定が困難であった。 Also, if the method whose performance you want to measure cannot be identified, such as identifying the bottleneck when a performance problem occurs, measure the execution time of all the methods to be executed and record the measured results. It is necessary to keep. However, since methods are generally called frequently at very short time intervals, frequent measurement and recording of the execution time itself consumes the resources of the system on which the program runs. For this reason, the measurement itself has an effect on performance, and accurate measurement has been difficult.
 これに対し、従来、1回目の測定において、荒い精度によって全てのメソッドの実行時間を測定し、所定の閾値以上の実行時間がかかったメソッドなど所定の条件に該当するメソッドを主要メソッドとして抽出する方法が開示されている(例えば、特許文献1参照)。そして、特許文献1は、2回目の測定において、前記主要メソッドのみを対象として詳細な精度で実行時間を測定する技術を開示する。 On the other hand, in the first measurement, the execution time of all methods is measured with rough accuracy, and a method that satisfies a predetermined condition such as a method that takes an execution time exceeding a predetermined threshold is extracted as a main method. A method is disclosed (for example, see Patent Document 1). Patent Document 1 discloses a technique for measuring the execution time with detailed accuracy only for the main method in the second measurement.
特開2008-217721号公報JP 2008-217721 A
 特許文献1に開示された技術は、特定の入力に対応する全てのメソッドを測定し、その統計情報(平均実行時間、実行回数)を生成する。このため、全体の実行時間が非常に短いプログラムを測定する場合、特許文献1に開示された技術は、正確な実行時間を取得できず、実際はボトルネックであるメソッドが、主要メソッドとして抽出されない場合がある。 The technique disclosed in Patent Document 1 measures all methods corresponding to a specific input and generates statistical information (average execution time, number of executions). For this reason, when measuring a program whose overall execution time is very short, the technique disclosed in Patent Document 1 cannot acquire an accurate execution time, and a method that is actually a bottleneck is not extracted as a main method. There is.
 さらに、特許文献1に開示された技術において用いられる所定の閾値は、どのメソッドにも一定値である。このため、例えば、性能に影響のある修正が加えられたプログラムと、修正される前のプログラムとの二つのプログラム間で性能の比較をする場合において、プログラム全体の実行時間と比較して実行時間に大きな差はないが、修正前と修正後とのメソッドの性能に著しい差が生じているメソッドを特定する、といった用途に、特許文献1に開示された技術は用いることができない。 Furthermore, the predetermined threshold value used in the technique disclosed in Patent Document 1 is a constant value for any method. For this reason, for example, when comparing performance between two programs, a program that has been modified that affects performance and a program that has not been modified, the execution time is compared with the execution time of the entire program. However, the technique disclosed in Patent Document 1 cannot be used for the purpose of identifying a method in which there is a significant difference in the performance of the method before and after the correction.
 本発明はこのような課題に鑑みてなされたものであり、処理性能に影響を与えるメソッドを精度よく特定し、かつ、処理性能を測定するプログラムの規模に関わらず、測定自体による処理性能への影響を低減する測定方法の提供を目的とする。 The present invention has been made in view of such problems, and can accurately specify a method that affects the processing performance, and can improve the processing performance by the measurement itself regardless of the scale of the program for measuring the processing performance. The purpose is to provide a measurement method that reduces the influence.
 また、本発明は、複数のプログラム間で性能に差が生じているメソッドを特定するための性能の測定方法の提供を目的とする。 Also, an object of the present invention is to provide a performance measurement method for specifying a method in which a difference in performance occurs between a plurality of programs.
 本発明の代表的な一例を示せば以下の通りである。すなわち、計算機によってプログラムの性能を測定する性能測定方法であって、前記計算機は、プロセッサと、前記プロセッサによって実行されるプログラムを格納するメモリとを有し、前記方法は、前記計算機が、前記性能が測定されるプログラムによって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを最初に決定する手順と、前記計算機が、前記プログラムを実行することによって、前記決定された各第1のメソッドの実行時間を測定する手順と、前記計算機が、前記測定された各第1のメソッドの実行時間を用いて、所定の条件に一致する少なくとも一つの第2のメソッドが前記各第1のメソッドから抽出可能か否かを判定する手順と、前記少なくとも一つの第2のメソッドが抽出可能である場合、前記計算機が、前記抽出された各第2のメソッドから直接呼ばれる少なくとも一つの第3のメソッドが抽出可能か否かを判定する手順と、前記少なくとも一つの第3のメソッドが抽出可能である場合、前記計算機が、前記抽出された第3のメソッドを、第1のメソッドに決定する手順と、前記計算機が、前記実行時間を測定する手順と、前記第2のメソッドが抽出可能か否かを判定する手順と、前記第3のメソッドが抽出可能か否かを判定する手順と、前記第3のメソッドを第1のメソッドに決定する手順とを繰り返し実行する手順とを含む。 A typical example of the present invention is as follows. That is, a performance measurement method for measuring the performance of a program by a computer, wherein the computer includes a processor and a memory for storing a program executed by the processor, and the method includes: A procedure for first determining at least one first method among methods directly called by a program to be measured, and execution of each determined first method by the computer executing the program Using the time measurement procedure and the execution time of each measured first method, the computer can extract at least one second method that matches a predetermined condition from each first method. If the procedure for determining whether or not the at least one second method can be extracted, A procedure for determining whether or not at least one third method called directly from each extracted second method can be extracted, and when the at least one third method can be extracted, A procedure for determining the extracted third method as a first method; a procedure for the computer to measure the execution time; and a procedure for determining whether or not the second method can be extracted; And a procedure for repeatedly executing a procedure for determining whether or not the third method can be extracted and a procedure for determining the third method as the first method.
 本発明の一実施形態によると、プログラムにおいて処理性能に影響を与えているメソッドを精度よく特定することができる。 According to an embodiment of the present invention, it is possible to accurately identify a method that affects processing performance in a program.
本発明の第1の実施形態の複数のプログラムの性能差を分析する計算機の構成を示すブロック図である。It is a block diagram which shows the structure of the computer which analyzes the performance difference of the some program of the 1st Embodiment of this invention. 本発明の第1の実施形態の対象メソッドテーブルを示す説明図である。It is explanatory drawing which shows the object method table of the 1st Embodiment of this invention. 本発明の第1の実施形態の第1メソッド呼出テーブルを示す説明図である。It is explanatory drawing which shows the 1st method call table of the 1st Embodiment of this invention. 本発明の第1の実施形態の第2メソッド呼出テーブルを示す説明図である。It is explanatory drawing which shows the 2nd method call table of the 1st Embodiment of this invention. 本発明の第1の実施形態の第1実行情報テーブルを示す説明図である。It is explanatory drawing which shows the 1st execution information table of the 1st Embodiment of this invention. 本発明の第1の実施形態の第2実行情報テーブルを示す説明図である。It is explanatory drawing which shows the 2nd execution information table of the 1st Embodiment of this invention. 本発明の第1の実施形態の測定結果テーブルを示す説明図である。It is explanatory drawing which shows the measurement result table of the 1st Embodiment of this invention. 本発明の第1の実施形態の測定結果を表示した場合の画面を示す説明図である。It is explanatory drawing which shows the screen at the time of displaying the measurement result of the 1st Embodiment of this invention. 本発明の第1の実施形態の全体の処理を示すフローチャートである。It is a flowchart which shows the whole process of the 1st Embodiment of this invention. 本発明の第1の実施形態の初期メソッドを示すシーケンス図である。It is a sequence diagram which shows the initial method of the 1st Embodiment of this invention. 本発明の第1の実施形態の初期メソッドを抽出する処理におけるデータの流れを示すブロック図である。It is a block diagram which shows the data flow in the process which extracts the initial method of the 1st Embodiment of this invention. 本発明の第1の実施形態の初期メソッドを抽出するためにテストを実行する処理を示すフローチャートである。It is a flowchart which shows the process which performs a test in order to extract the initial method of the 1st Embodiment of this invention. 本発明の第1の実施形態の測定対象メソッドを抽出する処理を示すフローチャートである。It is a flowchart which shows the process which extracts the measuring object method of the 1st Embodiment of this invention. 本発明の第1の実施形態の初期メソッドを抽出する処理を示すフローチャートである。It is a flowchart which shows the process which extracts the initial method of the 1st Embodiment of this invention. 本発明の第1の実施形態の測定対象メソッドの実行時間を測定する処理におけるデータの流れを示すブロック図である。It is a block diagram which shows the data flow in the process which measures the execution time of the measuring object method of the 1st Embodiment of this invention. 本発明の第1の実施形態の実行時間を測定するためにテストを実行する処理を示すフローチャートである。It is a flowchart which shows the process which performs a test in order to measure the execution time of the 1st Embodiment of this invention. 本発明の第1の実施形態の測定対象メソッドの実行時間を測定する処理を示すフローチャートである。It is a flowchart which shows the process which measures the execution time of the measuring object method of the 1st Embodiment of this invention. 本発明の第1の実施形態の性能差要因メソッドを抽出する処理を示すフローチャートである。It is a flowchart which shows the process which extracts the performance difference factor method of the 1st Embodiment of this invention. 本発明の第1の実施形態の測定対象メソッドを再度設定する処理を示すフローチャートである。It is a flowchart which shows the process which sets the measuring object method of the 1st Embodiment of this invention again. 本発明の第2の実施形態の単一のプログラムの性能差を分析する計算機の構成を示すブロック図である。It is a block diagram which shows the structure of the computer which analyzes the performance difference of the single program of the 2nd Embodiment of this invention. 本発明の第2の実施形態のメソッド呼出テーブルを示す説明図である。It is explanatory drawing which shows the method call table of the 2nd Embodiment of this invention. 本発明の第2の実施形態の実行情報テーブルを示す説明図である。It is explanatory drawing which shows the execution information table of the 2nd Embodiment of this invention. 本発明の第2の実施形態の測定結果テーブルを示す説明図である。It is explanatory drawing which shows the measurement result table of the 2nd Embodiment of this invention. 本発明の第2の実施形態の全体の処理を示すフローチャートである。It is a flowchart which shows the whole process of the 2nd Embodiment of this invention. 本発明の第2の実施形態の所定の条件を満たすメソッドを抽出する処理を示すフローチャートである。It is a flowchart which shows the process which extracts the method which satisfy | fills the predetermined condition of the 2nd Embodiment of this invention. 本発明の第2の実施形態の初期メソッドを指定するための画面を示す説明図である。It is explanatory drawing which shows the screen for designating the initial method of the 2nd Embodiment of this invention.
 以下、本発明について、図面を参照して説明する。 Hereinafter, the present invention will be described with reference to the drawings.
 図1は、本発明の第1の実施形態の複数のプログラムの性能差を分析する計算機100の構成を示すブロック図である。 FIG. 1 is a block diagram illustrating a configuration of a computer 100 that analyzes a performance difference between a plurality of programs according to the first embodiment of this invention.
 第1の実施形態の計算機100は、演算装置101、メモリ102、外部記憶装置103、出力装置104、及び入力装置105を備える。計算機100は、複数のプログラムの処理性能の差を分析する機能を備える装置である。 The computer 100 according to the first embodiment includes an arithmetic device 101, a memory 102, an external storage device 103, an output device 104, and an input device 105. The computer 100 is a device having a function of analyzing a difference in processing performance of a plurality of programs.
 演算装置101は、CPUなどのプロセッサである。演算装置101は、メモリ102においてプログラムを実行する。 The arithmetic unit 101 is a processor such as a CPU. The arithmetic device 101 executes a program in the memory 102.
 メモリ102は、一時的にデータを記憶するための領域を備える記憶装置である。メモリ102は、プログラム及びテーブルを保持する。 The memory 102 is a storage device having an area for temporarily storing data. The memory 102 holds programs and tables.
 外部記憶装置103は、ハードディスクドライブなどの記憶装置である。演算装置101によって実行されるプログラムに入力される引数等を保持する。 The external storage device 103 is a storage device such as a hard disk drive. An argument or the like input to a program executed by the arithmetic device 101 is held.
 出力装置104は、ディスプレイ又はプリンタ等の装置である。計算機100による処理の結果を、ユーザに提供するための装置である。入力装置105は、キーボード又はマウス等の装置である。ユーザは、演算装置101によって実行されるプログラムに入力される引数等を、入力装置105を介して計算機100に入力する。 The output device 104 is a device such as a display or a printer. This is an apparatus for providing a result of processing by the computer 100 to a user. The input device 105 is a device such as a keyboard or a mouse. A user inputs an argument or the like input to a program executed by the arithmetic device 101 to the computer 100 via the input device 105.
 メモリ102は、制御部106、テスト実行部107、メソッド呼出照合部108、性能差要因メソッド判定部109、バージョン切替部110、第1メソッド呼出テーブル111、第2メソッド呼出テーブル112、対象メソッドテーブル113、第1実行情報テーブル114、第2実行情報テーブル115、測定結果テーブル116、初期メソッド記録部117、対象メソッド記録部118、コールバック受信部119、第1プログラム120、第2プログラム121、JavaVM122(Javaは登録商標、以下同じ)、及び、JVMTI123を保持する。 The memory 102 includes a control unit 106, a test execution unit 107, a method call verification unit 108, a performance difference factor method determination unit 109, a version switching unit 110, a first method call table 111, a second method call table 112, and a target method table 113. , First execution information table 114, second execution information table 115, measurement result table 116, initial method recording unit 117, target method recording unit 118, callback receiving unit 119, first program 120, second program 121, Java VM 122 ( Java is a registered trademark, and the same shall apply hereinafter) and JVMTI123.
 制御部106、テスト実行部107、メソッド呼出照合部108、性能差要因メソッド判定部109、バージョン切替部110、初期メソッド記録部117、対象メソッド記録部118、コールバック受信部119、第1プログラム120、第2プログラム121、JavaVM122、及び、JVMTI123は、プログラムである。第1メソッド呼出テーブル111、第2メソッド呼出テーブル112、対象メソッドテーブル113、第1実行情報テーブル114、第2実行情報テーブル115、及び、測定結果テーブル116は、データが格納されるテーブルである。 Control unit 106, test execution unit 107, method call verification unit 108, performance difference factor method determination unit 109, version switching unit 110, initial method recording unit 117, target method recording unit 118, callback reception unit 119, first program 120 The second program 121, the Java VM 122, and the JVMTI 123 are programs. The first method call table 111, the second method call table 112, the target method table 113, the first execution information table 114, the second execution information table 115, and the measurement result table 116 are tables in which data is stored.
 制御部106は、バージョン切替部110に第1プログラム120又は第2プログラム121を実行可能な状態に切り替えさせ、テスト実行部107に第1プログラム120又は第2プログラム121を実行(テスト)させる。また、第1プログラム120又は第2プログラム121を実行させることによって取得された測定結果の集計を同期させるなど、メモリ102において実行されるプログラムを制御する。 The control unit 106 causes the version switching unit 110 to switch to a state where the first program 120 or the second program 121 can be executed, and causes the test execution unit 107 to execute (test) the first program 120 or the second program 121. In addition, the program executed in the memory 102 is controlled, for example, the measurement results obtained by executing the first program 120 or the second program 121 are synchronized.
 テスト実行部107は、第1プログラム120又は第2プログラム121のうち実行可能な状態になっているプログラムに、あらかじめユーザによって指定された所定の値を入力し、第1プログラム120又は第2プログラム121を実行する。そして、これによって、性能を測定するために必要な負荷をかけて、第1プログラム120又は第2プログラム121を実行する。 The test execution unit 107 inputs a predetermined value designated in advance by the user to a program that is in an executable state of the first program 120 or the second program 121, and the first program 120 or the second program 121. Execute. Then, the first program 120 or the second program 121 is executed by applying a load necessary for measuring the performance.
 メソッド呼出照合部108は、初期メソッド又は性能差要因メソッドによって直接呼ばれたメソッドのうち、所定の条件に一致するメソッドを次の測定対象に設定するため、所定の条件に一致するメソッドを示す情報を対象メソッドテーブル113に格納する。 The method call matching unit 108 sets information that indicates a method that matches a predetermined condition in order to set a method that matches a predetermined condition as a next measurement target among methods called directly by the initial method or the performance difference factor method. Are stored in the target method table 113.
 なお、第1の実施形態において初期メソッドとは、第1プログラム120又は第2プログラム121をテストしている期間中、各スレッドにおいて最初に呼ばれるメソッドである。また、第1の実施形態において性能差要因メソッドとは、第1プログラム120と第2プログラム121との性能に差があった場合、最も性能の差を発生させる要因となるメソッドである。 In the first embodiment, the initial method is a method that is called first in each thread during the period when the first program 120 or the second program 121 is being tested. In the first embodiment, the performance difference factor method is a method that causes the difference in performance most when there is a difference in performance between the first program 120 and the second program 121.
 性能差要因メソッド判定部109は、第1実行情報テーブル114及び第2実行情報テーブル115に格納されたメソッドの開始時刻とメソッドの終了時刻との差分に基づいて、性能を示す値を算出する。そして、測定結果テーブル116に算出された値を格納する。 The performance difference factor method determination unit 109 calculates a value indicating performance based on the difference between the method start time and the method end time stored in the first execution information table 114 and the second execution information table 115. Then, the calculated value is stored in the measurement result table 116.
 具体的には、性能差要因メソッド判定部109は、第1プログラム120及び第2プログラム121における測定対象メソッドの平均実行時間と実行回数とを、第1実行情報テーブル114及び第2実行情報テーブル115から抽出する。そして、抽出された値に基づいて、第1プログラム120と第2プログラム121との実行時間差と実行時間比とを算出する。そして、算出された値を測定結果テーブル116に格納する。さらに、測定結果テーブル116に出力された実行時間差と実行時間比とに基づいて、性能差要因メソッドを抽出する。 Specifically, the performance difference factor method determination unit 109 calculates the average execution time and the number of executions of the measurement target method in the first program 120 and the second program 121 as the first execution information table 114 and the second execution information table 115. Extract from Then, based on the extracted value, an execution time difference and an execution time ratio between the first program 120 and the second program 121 are calculated. The calculated value is stored in the measurement result table 116. Further, a performance difference factor method is extracted based on the execution time difference and the execution time ratio output to the measurement result table 116.
 ここで、測定対象メソッドとは、本実施形態において性能を測定する対象のメソッドである。 Here, the measurement target method is a method whose performance is measured in the present embodiment.
 バージョン切替部110は、第1プログラム120及び第2プログラム121のうち、制御部106から指定されたプログラムを起動し、第1プログラム120又は第2プログラム121を実行可能な状態にする。 The version switching unit 110 activates the program designated by the control unit 106 out of the first program 120 and the second program 121 to make the first program 120 or the second program 121 executable.
 第1プログラム120及び第2プログラム121は、第1の実施形態の計算機100によって、性能を測定されるプログラムである。第1の実施形態において、第1プログラム120はユーザによる修正前のプログラムであり、第2プログラム121はユーザによる修正後のプログラムである。 The first program 120 and the second program 121 are programs whose performance is measured by the computer 100 according to the first embodiment. In the first embodiment, the first program 120 is a program before correction by the user, and the second program 121 is a program after correction by the user.
 本実施形態の第1プログラム120及び第2プログラム121は、Java等によって作成されたプログラムであり、JavaVM(仮想マシン上)122において実行される。JavaVM122は、第1プログラム120及び第2プログラム121によって呼ばれるメソッドが、開始された時及び終了した時において、コールバックを発行するためのプロファイル機能を備える。JVMTI123は、本実施形態のJavaVM122に備わり、コールバックを発行するためのプロファイル機能である。 The first program 120 and the second program 121 of this embodiment are programs created by Java or the like, and are executed in the Java VM (on the virtual machine) 122. The Java VM 122 has a profile function for issuing a callback when a method called by the first program 120 and the second program 121 is started and ended. The JVMTI 123 is a profile function for issuing a callback provided in the Java VM 122 of the present embodiment.
 しかし、本発明の第1プログラム120及び第2プログラム121は、Java言語によって作成されたプログラムに限られるものではなく、第1プログラム120及び第2プログラム121によって呼ばれるメソッド(又は、メソッドに相当するサブルーチン)が開始された時及び終了した時において、コールバック(又は、コールバックに相当する信号)を発行する手段を含む言語であれば、いかなる言語によって作成されてもよい。そして、JavaVM122及びJVMTI123は、第1プログラム120及び第2プログラム121の言語に対応した、第1プログラム120及び第2プログラム121を実行するための環境であれば、いかなる環境でもよい。 However, the first program 120 and the second program 121 of the present invention are not limited to programs created in the Java language, but methods (or subroutines corresponding to methods) called by the first program 120 and the second program 121. ) May be created in any language as long as it includes a means for issuing a callback (or a signal corresponding to the callback) at the time of starting and ending. The Java VM 122 and the JVMTI 123 may be any environment as long as it is an environment for executing the first program 120 and the second program 121 corresponding to the languages of the first program 120 and the second program 121.
 コールバック受信部119は、JVMTI123によって発行されるコールバックを受信し、コールバックが受信された時刻を、計算機100が備える高精度タイマを用いて生成する。そして、生成された時刻と、コールバックに含まれるメソッドを示す情報(クラス名、メソッド名、メソッド識別子、呼び出し元のメソッドを示す情報、及び、コールスタックのフレーム番号など)と、メソッドが開始されたか終了したかを示す情報とを、初期メソッド記録部117又は対象メソッド記録部118に送信する。 The callback receiving unit 119 receives a callback issued by the JVMTI 123, and generates a time when the callback is received using a high-precision timer provided in the computer 100. Then, the generated time, information indicating the method included in the callback (class name, method name, method identifier, information indicating the calling method, frame number of the call stack, etc.) and the method are started. Information indicating whether or not the process has been completed is transmitted to the initial method recording unit 117 or the target method recording unit 118.
 初期メソッド記録部117は、テスト実行部107によって第1プログラム120及び第2プログラム121に値が入力されている間(すなわち、第1プログラム120又は第2プログラム121がテストされている間)に、コールスタックに格納された最も上位のメソッドを抽出する。そして、抽出されたメソッドを示す情報を、各々第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112に格納する。 The initial method recording unit 117 is in a state where values are input to the first program 120 and the second program 121 by the test execution unit 107 (that is, while the first program 120 or the second program 121 is being tested). Extracts the highest method stored in the call stack. Then, information indicating the extracted method is stored in the first method call table 111 and the second method call table 112, respectively.
 本実施形態において、第1プログラム120又は第2プログラム121に呼ばれたメソッドは、スレッド毎のコールスタックに格納され、開始される。そして、最も遅くコールスタックに格納され(PUSH)たメソッドは、最も早くコールスタックから取得される(POP)。すなわち、最も遅く開始されたメソッドが、最も早く終了する。 In this embodiment, the method called by the first program 120 or the second program 121 is stored in the call stack for each thread and started. Then, the latest method stored in the call stack (PUSH) is acquired from the call stack earliest (POP). That is, the latest started method finishes earliest.
 本実施形態において、コールスタックに最も早く格納されたメソッドは、最も上位のメソッドと記載され、コールスタックに最も上位のメソッドより遅く格納されたメソッドは、下位のメソッドと記載される。 In this embodiment, the method stored earliest in the call stack is described as the highest method, and the method stored later than the highest method in the call stack is described as a lower method.
 対象メソッド記録部118は、テスト実行部107によって第1プログラム120又は第2プログラム121に値が入力されている間(すなわち、第1プログラム120又は第2プログラム121がテストされている間)に、対象メソッドテーブル113に格納されている測定対象メソッドが開始された時刻及び終了した時刻と、メソッドを示す情報とを、コールバック受信部119から受信する。そして、コールバック受信部119から受信された時刻等の情報を、第1実行情報テーブル114又は第2実行情報テーブル115に格納する。 The target method recording unit 118 is during the time when a value is input to the first program 120 or the second program 121 by the test execution unit 107 (that is, while the first program 120 or the second program 121 is being tested). The start time and end time of the measurement target method stored in the target method table 113 and information indicating the method are received from the callback receiving unit 119. Information such as the time received from the callback receiver 119 is stored in the first execution information table 114 or the second execution information table 115.
 また、対象メソッド記録部118は、第1プログラム120又は第2プログラム121を測定している間に、測定対象メソッドによって直接呼ばれたメソッドを示す情報を抽出する。そして、抽出されたメソッドを示す情報を、第1メソッド呼出テーブル111又は第2メソッド呼出テーブル112に格納する。 Further, the target method recording unit 118 extracts information indicating a method directly called by the measurement target method while measuring the first program 120 or the second program 121. Then, information indicating the extracted method is stored in the first method call table 111 or the second method call table 112.
 第1メソッド呼出テーブル111は、第1プログラム120によって呼ばれたメソッドを示す情報が格納されるテーブルである。第2メソッド呼出テーブル112は、第2プログラム121によって呼ばれたメソッドを示す情報が格納されるテーブルである。対象メソッドテーブル113は、第1プログラム120及び第2プログラム121によって呼ばれたメソッドのうち、第1プログラム120と第2プログラム121との間で共通のメソッドを示す情報が格納されるテーブルである。 The first method call table 111 is a table in which information indicating a method called by the first program 120 is stored. The second method call table 112 is a table in which information indicating a method called by the second program 121 is stored. The target method table 113 is a table in which information indicating methods common to the first program 120 and the second program 121 among methods called by the first program 120 and the second program 121 is stored.
 第1実行情報テーブル114は、第1プログラム120によって呼ばれたメソッドの開始時刻と終了時刻とが格納されるテーブルである。第2実行情報テーブル115は、第2プログラム121によって呼ばれたメソッドの開始時刻と終了時刻とが格納されるテーブルである。測定結果テーブル116は、第1実行情報テーブル114及び第2実行情報テーブル115に格納される各メソッドの開始時刻と終了時刻とに基づいて算出された、第1プログラム120と第2プログラム121との性能を比較するための値が格納されるテーブルである。 The first execution information table 114 is a table in which the start time and end time of the method called by the first program 120 are stored. The second execution information table 115 is a table in which the start time and end time of the method called by the second program 121 are stored. The measurement result table 116 includes the first program 120 and the second program 121 calculated based on the start time and end time of each method stored in the first execution information table 114 and the second execution information table 115. It is a table in which the value for comparing performance is stored.
 図2は、本発明の第1の実施形態の対象メソッドテーブル113を示す説明図である。 FIG. 2 is an explanatory diagram illustrating the target method table 113 according to the first embodiment of this invention.
 対象メソッドテーブル113は、開始時刻と終了時刻とが測定されるメソッドを示す情報が格納される。対象メソッドテーブル113に格納される値は、第1プログラム120又は第2プログラム121によって呼ばれたメソッドが、さらに別のメソッドを呼ぶ場合に更新される。すなわち、測定対象メソッドによって呼ばれたメソッドを、さらに次の測定対象メソッドとするため、対象メソッドテーブル113は更新される。 The target method table 113 stores information indicating a method whose start time and end time are measured. The value stored in the target method table 113 is updated when a method called by the first program 120 or the second program 121 calls another method. That is, the target method table 113 is updated in order to set the method called by the measurement target method as the next measurement target method.
 対象メソッドテーブル113は、フレーム番号1131、メソッド情報1132、及び、呼出元メソッド情報1133を含む。フレーム番号1131は、コールスタックに格納されるメソッドの順番を示す数字である。フレーム番号1131の値が小さい程、コールスタックにおいて上位のメソッドであることを示す。 The target method table 113 includes a frame number 1131, method information 1132, and caller method information 1133. The frame number 1131 is a number indicating the order of methods stored in the call stack. A smaller frame number 1131 indicates a higher method in the call stack.
 メソッド情報1132は、測定対象メソッドを示す情報が含まれる。メソッド情報1132に格納される値は、測定対象メソッドのクラス名とメソッド名とを含み、測定対象メソッドを一意に示す識別子である。 The method information 1132 includes information indicating the measurement target method. The value stored in the method information 1132 is an identifier that uniquely indicates the measurement target method, including the class name and method name of the measurement target method.
 呼出元メソッド情報1133は、メソッド情報1132に示す測定対象メソッドを呼んだメソッドを示す情報を含む。呼出元メソッド情報1133に格納される値は、メソッド情報1132に格納される値と同じ表記方法である。すなわち、呼出元メソッド情報1133に格納される値は、呼出元メソッドのクラス名とメソッド名とを含み、呼出元メソッドを一意に示す識別子である。 The caller method information 1133 includes information indicating a method that called the measurement target method indicated in the method information 1132. The value stored in the caller method information 1133 has the same notation method as the value stored in the method information 1132. That is, the value stored in the caller method information 1133 is an identifier that uniquely indicates the caller method, including the class name and method name of the caller method.
 図3Aは、本発明の第1の実施形態の第1メソッド呼出テーブル111を示す説明図である。 FIG. 3A is an explanatory diagram illustrating the first method call table 111 according to the first embodiment of this invention.
 第1メソッド呼出テーブル111は、第1プログラム120が測定される際に、第1プログラム120によって呼ばれるメソッドを示す情報が格納される。第1メソッド呼出テーブル111は、フレーム番号1111、メソッド情報1112、及び、呼出元メソッド情報1113を含む。フレーム番号1111、メソッド情報1112、及び、呼出元メソッド情報1113は、対象メソッドテーブル113のフレーム番号1131、メソッド情報1132、及び、呼出元メソッド情報1133に相当する。 The first method call table 111 stores information indicating a method called by the first program 120 when the first program 120 is measured. The first method call table 111 includes a frame number 1111, method information 1112, and call source method information 1113. The frame number 1111, the method information 1112, and the call source method information 1113 correspond to the frame number 1131, the method information 1132, and the call source method information 1133 in the target method table 113.
 第1プログラム120に呼ばれた初期メソッドの開始時刻及び終了時刻を測定されている間、第1メソッド呼出テーブル111のメソッド情報1112には、初期メソッドによって直接呼ばれるメソッドを示す情報が、対象メソッド記録部118によって蓄積される。また、初期メソッドよりも下位の測定対象メソッドの開始時刻及び終了時刻が測定されている間、第1メソッド呼出テーブル111のメソッド情報1112には、測定対象メソッドによって直接呼ばれるメソッドを示す情報が、対象メソッド記録部118によって蓄積される。 While the start time and end time of the initial method called by the first program 120 are being measured, the method information 1112 of the first method call table 111 includes information indicating the method directly called by the initial method. Accumulated by the unit 118. Further, while the start time and end time of the measurement target method lower than the initial method are being measured, the method information 1112 of the first method call table 111 includes information indicating a method directly called by the measurement target method. Accumulated by the method recording unit 118.
 図3Bは、本発明の第1の実施形態の第2メソッド呼出テーブル112を示す説明図である。 FIG. 3B is an explanatory diagram illustrating the second method call table 112 according to the first embodiment of this invention.
 第2メソッド呼出テーブル112は、第2プログラム121が測定される際に、第2プログラム121によって呼ばれるメソッドを示す情報が格納される。第2メソッド呼出テーブル112は、フレーム番号1121、メソッド情報1122、及び、呼出元メソッド情報1123を含む。フレーム番号1121、メソッド情報1122、及び、呼出元メソッド情報1123は、対象メソッドテーブル113のフレーム番号1131、メソッド情報1132、及び、呼出元メソッド情報1133に相当する。 The second method call table 112 stores information indicating a method called by the second program 121 when the second program 121 is measured. The second method call table 112 includes a frame number 1121, method information 1122, and call source method information 1123. The frame number 1121, method information 1122, and call source method information 1123 correspond to the frame number 1131, method information 1132, and call source method information 1133 in the target method table 113.
 第2メソッド呼出テーブル112に格納される情報は、第1メソッド呼出テーブル111に格納される情報と同様であり、第2プログラム121が実行されることによって抽出された値が格納される。 The information stored in the second method call table 112 is the same as the information stored in the first method call table 111, and a value extracted by executing the second program 121 is stored.
 図4Aは、本発明の第1の実施形態の第1実行情報テーブル114を示す説明図である。 FIG. 4A is an explanatory diagram illustrating the first execution information table 114 according to the first embodiment of this invention.
 第1実行情報テーブル114は、第1プログラム120によって呼ばれたメソッドの、開始時刻又は終了時刻を格納するテーブルである。第1実行情報テーブル114は、フレーム番号1141、メソッド情報1142、開始終了情報1143、及び時刻1144を含む。フレーム番号1141及びメソッド情報1142は、対象メソッドテーブル113のフレーム番号1131及びメソッド情報1132に相当する。 The first execution information table 114 is a table that stores a start time or an end time of a method called by the first program 120. The first execution information table 114 includes a frame number 1141, method information 1142, start / end information 1143, and time 1144. The frame number 1141 and the method information 1142 correspond to the frame number 1131 and the method information 1132 of the target method table 113.
 開始終了情報1143に格納される値は、各行に含まれる時刻1144が、メソッド情報1142が示すメソッドの開始時刻を示す場合"開始"であり、各行に含まれる時刻1144が、メソッド情報1132が示すメソッドの終了時刻を示す場合"終了"である。 The value stored in the start / end information 1143 is “start” when the time 1144 included in each row indicates the start time of the method indicated by the method information 1142, and the time 1144 included in each row is indicated by the method information 1132. “End” indicates the end time of the method.
 時刻1144は、メソッド情報1142が示すメソッドの開始時刻又は終了時刻を示す。図4Aに示す時刻1144は、計算機100において用いられるシステム時刻によって表記されるが、いかなる表記方法で時刻を示してもよい。 The time 1144 indicates the start time or end time of the method indicated by the method information 1142. Although the time 1144 shown in FIG. 4A is expressed by the system time used in the computer 100, the time may be indicated by any notation method.
 図4Bは、本発明の第1の実施形態の第2実行情報テーブル115を示す説明図である。 FIG. 4B is an explanatory diagram illustrating the second execution information table 115 according to the first embodiment of this invention.
 第2実行情報テーブル115は、第2プログラム121によって呼ばれたメソッドの、開始時刻又は終了時刻を格納するテーブルである。第2実行情報テーブル115に格納される情報は、第1実行情報テーブル114と同様の情報であり、第2プログラム121が実行されることによって抽出される値が格納される。 The second execution information table 115 is a table for storing the start time or end time of the method called by the second program 121. The information stored in the second execution information table 115 is the same information as the first execution information table 114, and stores the value extracted by executing the second program 121.
 前述の第1メソッド呼出テーブル111、第2メソッド呼出テーブル112、対象メソッドテーブル113、第1実行情報テーブル114及び第2実行情報テーブル115において、計算機100による測定の対象とするメソッドが、次の測定対象メソッドに移行する際、各テーブルが更新され、各テーブルのフレーム番号が更新されてよい。すなわち、第1メソッド呼出テーブル111、第2メソッド呼出テーブル112、対象メソッドテーブル113、第1実行情報テーブル114及び第2実行情報テーブル115に含まれるフレーム番号は、各測定の時点においてすべて同じ値を示してよい。 In the first method call table 111, the second method call table 112, the target method table 113, the first execution information table 114, and the second execution information table 115, the method to be measured by the computer 100 is the next measurement. When shifting to the target method, each table may be updated, and the frame number of each table may be updated. That is, the frame numbers included in the first method call table 111, the second method call table 112, the target method table 113, the first execution information table 114, and the second execution information table 115 all have the same value at the time of each measurement. May show.
 ただし、測定対象メソッドが識別できれば、各テーブルはいずれの方法によって値を格納してもよく、例えば、測定対象メソッドを示すフレーム番号を変数によって保持し、変数が示すフレーム番号の測定対象メソッドを、計算機100に測定させるなどの方法を用いてもよい。 However, as long as the measurement target method can be identified, each table may store the value by any method.For example, the frame number indicating the measurement target method is held by a variable, and the measurement target method having the frame number indicated by the variable is A method of causing the computer 100 to measure may be used.
 図5は、本発明の第1の実施形態の測定結果テーブル116を示す説明図である。 FIG. 5 is an explanatory diagram illustrating the measurement result table 116 according to the first embodiment of this invention.
 測定結果テーブル116は、第1実行情報テーブル114及び第2実行情報テーブル115に含まれる開始時刻と終了時刻とに基づいて算出された値をメソッドごとに格納するテーブルである。 The measurement result table 116 is a table that stores, for each method, values calculated based on the start time and end time included in the first execution information table 114 and the second execution information table 115.
 測定結果テーブル116は、フレーム番号1161、メソッド情報1162、第1プログラムの平均実行時間11631及び実行回数11632、第2プログラムの平均実行時間11641及び実行回数11642、実行時間差1165、並びに、実行時間比1166を含む。 The measurement result table 116 includes frame number 1161, method information 1162, average execution time 11631 and execution count 11632 of the first program, average execution time 11641 and execution count 11642 of the second program, execution time difference 1165, and execution time ratio 1166. including.
 フレーム番号1161は、コールスタックに格納されるメソッドの順番を示す数字である。測定結果テーブル116の行は、メソッドが測定される都度追加されるため、フレーム番号1161は、少なくとも一つの値を示す。 The frame number 1161 is a number indicating the order of methods stored in the call stack. Since a row of the measurement result table 116 is added every time a method is measured, the frame number 1161 indicates at least one value.
 メソッド情報1162は、測定されたメソッドを示す情報を格納する。 The method information 1162 stores information indicating the measured method.
 第1プログラムの平均実行時間11631は、各メソッドが呼出元メソッドから複数回呼ばれる場合において、複数回呼ばれた各メソッドの実行時間の平均値である。 The average execution time 11631 of the first program is an average value of the execution times of each method called multiple times when each method is called multiple times from the calling method.
 例えば、第1実行情報テーブル114のメソッド情報1142に含まれるメソッドを抽出し、抽出されたメソッドの各々の終了時刻から開始時刻を減算することによって、1回目の実行時間が算出される。そして、抽出されたメソッドと同じメソッドを示すメソッドを、さらにメソッド情報1142から抽出し、さらに抽出されたメソッドの実行時間を算出することによって2回目の実行時間が算出される。このように算出された複数回の実行時間の平均値を算出することによって、平均実行時間11631が算出される。 For example, the first execution time is calculated by extracting the method included in the method information 1142 of the first execution information table 114 and subtracting the start time from the end time of each extracted method. Then, a method indicating the same method as the extracted method is further extracted from the method information 1142, and the second execution time is calculated by calculating the execution time of the extracted method. The average execution time 11631 is calculated by calculating the average value of the execution times calculated in this way.
 第1プログラムの実行回数11632は、呼出元メソッドから呼ばれた回数を示す。第1実行情報テーブル114のうち、開始終了情報1153に開始及び終了の両方を含むメソッドが、第1実行情報テーブル114にいくつ含まれるかを算出することによって、求められる。 The number of executions 11632 of the first program indicates the number of calls from the caller method. In the first execution information table 114, the number of methods including both start and end in the start / end information 1153 is obtained by calculating how many methods are included in the first execution information table 114.
 第2プログラムの平均実行時間11641及び第2プログラムの実行回数11642には、第1プログラムの平均実行時間11631及び実行回数11632と同様な値が格納され、第2実行情報テーブル115に基づいて算出された値が格納される。 The average execution time 11641 of the second program and the execution count 11642 of the second program store the same values as the average execution time 11631 and the execution count 11632 of the first program, and are calculated based on the second execution information table 115. Stored value.
 実行時間差1165は、呼出元メソッドが1回実行される毎の、メソッド情報1162が示すメソッドの実行時間の合計を、第1プログラム120と第2プログラム121とにおいて算出し、算出された各結果の差を示す。具体的には、第1プログラム120及び第2プログラム121の結果に基づいて、各々、メソッド情報1162が示すメソッドが実行された実行時間の合計を算出する。そして、実行時間の合計を、呼出元メソッドが実行された回数(呼出元メソッドが示す実行回数11632に相当)によって除算する。 The execution time difference 1165 is calculated by calculating the total execution time of the method indicated by the method information 1162 in each of the first program 120 and the second program 121 every time the caller method is executed once. Indicates the difference. Specifically, based on the results of the first program 120 and the second program 121, the total execution time during which the method indicated by the method information 1162 is executed is calculated. Then, the total execution time is divided by the number of times the caller method is executed (corresponding to the execution number 11632 indicated by the caller method).
 そして、前述の方法によって算出された値を、第1プログラム120と第2プログラム121とについて生成する。そして、第1プログラム120の算出された値によって、第2プログラム121の算出された値を減算することによって、実行時間差1165が算出される。 Then, the values calculated by the above-described method are generated for the first program 120 and the second program 121. Then, the execution time difference 1165 is calculated by subtracting the value calculated by the second program 121 from the value calculated by the first program 120.
 本発明は、実行時間差1165によって、呼出元メソッドが1回実行される毎の、メソッドの実行時間の差を算出することができる。 The present invention can calculate the difference in method execution time each time the caller method is executed by the execution time difference 1165.
 例えば、図5に示すメソッド情報1162"aaa.bbb.MyClass.start(int)"の実行時間差1165の算出方法を以下に示す。図5は、メソッド"aaa.bbb.MyClass.start(int)"が、"aaa.bbb.Starter.doStart()"から呼ばれることによって実行されることを示す。 For example, a method for calculating the execution time difference 1165 of the method information 1162 “aaa.bbb.MyClass.start (int)” shown in FIG. FIG. 5 shows that the method “aaa.bbb.MyClass.start (int)” is executed by being called from “aaa.bbb.Starter.doStart ()”.
 第1プログラムにおいて実行される場合において、メソッド"aaa.bbb.MyClass.start(int)"の呼出元メソッドによって呼ばれる回数は、図5の実行回数11632が示す通り、25回である。そして、呼出元メソッドである"aaa.bbb.Starter.doStart()"の実行回数11632は5回である。すなわち、図5は、メソッド"aaa.bbb.Starter.doStart()"が1回実行される毎に、メソッド"aaa.bbb.MyClass.start(int)"が5回(25/5=5)呼ばれることを示す。 When executed in the first program, the number of times called by the calling method of the method “aaa.bbb.MyClass.start (int)” is 25, as indicated by the number of executions 11632 in FIG. The number of executions 11632 of the caller method “aaa.bbb.Starter.doStart ()” is five. That is, FIG. 5 shows that each time the method “aaa.bbb.Starter.doStart ()” is executed once, the method “aaa.bbb.MyClass.start (int)” is executed five times (25/5 = 5). Indicates that it is called.
 なお、図5において、メソッド"aaa.bbb.MyClass.start(int)"及びメソッド"aaa.bbb.Starter.doStart()"の、第2プログラムにおける実行回数11642は、第1プログラムにおける実行回数11632と同じである。 In FIG. 5, the number of executions 11642 in the second program of the method “aaa.bbb.MyClass.start (int)” and the method “aaa.bbb.Starter.doStart ()” is the number of executions 11632 in the first program. Is the same.
 そして、実行時間差1165は、第1プログラムにおいて呼出元メソッドが1回実行される毎のメソッドの合計実行時間と、第2プログラムにおいて呼出元メソッドが1回実行される毎のメソッドの合計実行時間との差である。このため、メソッド"aaa.bbb.MyClass.start(int)"の実行時間差1165は、第2プログラムの(平均実行時間11641×(メソッドの実行回数11642/呼出元メソッドの実行回数11642)-第1プログラムの(平均実行時間11631×(メソッドの実行回数11632/呼出元メソッドの実行回数11632)=12070×(25/5)-11480×(25/5)=2950と算出される。 The execution time difference 1165 is the total execution time of the method every time the caller method is executed once in the first program, and the total execution time of the method every time the caller method is executed once in the second program. Is the difference. For this reason, the execution time difference 1165 of the method “aaa.bbb.MyClass.start (int)” is (average execution time 11641 × (method execution count 11642 / calling method execution count 11642) −first program). (Average execution time 11631 × (method execution count 11632 / calling method execution count 11632) = 112070 × (25/5) −11480 × (25/5) = 2950 of the program.
 ここで、呼出元メソッドがメソッドを呼ぶ回数が、第1プログラム120と第2プログラム121とにおいて相違する場合においても、実行時間差1165は、前述の式によって算出される。 Here, even when the number of times the caller method calls the method differs between the first program 120 and the second program 121, the execution time difference 1165 is calculated by the above-described equation.
 実行時間比1166は、メソッド情報1162が示すメソッドの1回あたりの実行時間の、第1のプログラム及び第2のプログラムとにおける差を算出し、算出された値を平均する。そして、平均された値を、第1プログラムの平均実行時間11631によって除算することによって算出された値である。 The execution time ratio 1166 calculates the difference between the execution time per method indicated by the method information 1162 between the first program and the second program, and averages the calculated values. And it is a value calculated by dividing the averaged value by the average execution time 11631 of the first program.
 すなわち、実行時間比1166は、メソッドが1回実行される毎の、新旧のメソッドにおける実行時間の差の比率である。本発明は、実行時間比1166によって、各メソッドの実行時間の変化率を算出することができる。 That is, the execution time ratio 1166 is a ratio of execution time differences between the old and new methods each time the method is executed once. The present invention can calculate the rate of change of the execution time of each method based on the execution time ratio 1166.
 具体的には、実行時間比1166は、実行時間差1165が示す値を、呼出元メソッドが1回実行される毎の、メソッド情報1162が示すメソッドの実行回数によって除算した値を、さらに、第1プログラムの平均実行時間11631によって除算した値である。 Specifically, the execution time ratio 1166 is a value obtained by dividing the value indicated by the execution time difference 1165 by the number of times the method indicated by the method information 1162 is executed each time the call source method is executed once. It is a value divided by the average execution time 11631 of the program.
 例えば、図5において"aaa.bbb.MyClass.start(int)"は、前述のとおり、呼出元メソッドが1回実行される毎に、5回呼ばれるため、実行時間比1166は、(2950/5)/11480=0.051と算出される。 For example, in FIG. 5, “aaa.bbb.MyClass.start (int)” is called five times each time the caller method is executed as described above, and therefore the execution time ratio 1166 is (2950/5). ) /11480=0.051.
 なお、測定結果テーブル116において、初期メソッドの実行時間差1165及び実行時間比1166は、呼出元メソッド(すなわち、第1プログラム又は第2プログラム)の実行回数は、1として算出される。 In the measurement result table 116, the execution time difference 1165 and the execution time ratio 1166 of the initial method are calculated by assuming that the number of executions of the caller method (that is, the first program or the second program) is 1.
 図6は、本発明の第1の実施形態の測定結果を表示した場合の画面130を示す説明図である。 FIG. 6 is an explanatory diagram showing a screen 130 when the measurement result of the first embodiment of the present invention is displayed.
 画面130は、本実施形態によって測定された結果を、出力装置104を介してユーザに提供するための画面である。画面130は、表示131、表示132、及び表示133を含む。 The screen 130 is a screen for providing the user with the result measured by the present embodiment via the output device 104. The screen 130 includes a display 131, a display 132, and a display 133.
 表示131は、性能差要因メソッドであるメソッド名と、性能差要因メソッドである理由とを示す。図6に示す表示131は、呼出元メソッドである"aaa.bbb.MyClass.start(int)"が、"java.util.Map.get(Object)"を呼ぶ回数が増加しており、第1プログラム120においては200回呼び、第2プログラム121においては210回呼んでいることを示す。 The display 131 shows a method name that is a performance difference factor method and a reason that it is a performance difference factor method. The display 131 shown in FIG. 6 shows that the number of times that “aaa.bbb.MyClass.start (int)”, which is the calling method, calls “java.util.Map.get (Object)” is increased. The program 120 is called 200 times, and the second program 121 is called 210 times.
 なお、呼出元メソッドがメソッドを呼ぶ回数は、呼ばれたメソッドの実行回数(測定結果テーブル116の第1プログラムの実行回数11632又は第2プログラムの実行回数11642)を、呼出元メソッドの実行回数(測定結果テーブル116の第1プログラムの実行回数11632又は第2プログラムの実行回数11642)によって除算することによって算出される。 Note that the number of times the calling source method calls the method is the number of executions of the called method (the number of executions 11632 of the first program or the number of executions 11642 of the second program in the measurement result table 116). It is calculated by dividing by the number of executions 11632 of the first program or the number of executions 11642 of the second program in the measurement result table 116.
 表示132は、性能差要因メソッドが呼ばれるまでに呼ばれたメソッドを、階層構造によって示した表示である。すなわち、性能差要因メソッドを含むコールスタックをトレースした結果を示す。表示132には、性能差要因メソッドを含むコールスタックの各メソッドと、各メソッドにおける第1プログラム120と第2プログラム121との性能の差を示す。 The display 132 is a display showing the method called by the hierarchical structure before the performance difference factor method is called. That is, the result of tracing the call stack including the performance difference factor method is shown. The display 132 shows each method of the call stack including the performance difference factor method and the performance difference between the first program 120 and the second program 121 in each method.
 表示133は、測定結果テーブル116を含む情報を表示する。図6に示す表示133は、測定結果テーブル116の情報と、対象メソッドテーブル113の呼出元メソッド情報1133とを含む。 The display 133 displays information including the measurement result table 116. The display 133 illustrated in FIG. 6 includes information of the measurement result table 116 and caller method information 1133 of the target method table 113.
 <処理説明>
 図7は、本発明の第1の実施形態の全体の処理を示すフローチャートである。
<Description of processing>
FIG. 7 is a flowchart showing the overall processing of the first embodiment of the present invention.
 制御部106は、まず、第1プログラム120及び第2プログラム121の初期メソッドを抽出し、抽出された初期メソッドのうち、第1プログラム120及び第2プログラム121において共通するメソッドを対象メソッドテーブル113に格納する。すなわち、対象メソッドテーブル113は、第1プログラム120及び第2プログラム121において共通するメソッドを対象メソッドテーブル113に格納することによって、開始時刻及び終了時刻を測定するメソッド(測定対象メソッド)を、対象メソッドテーブル113に格納する(140)。 First, the control unit 106 extracts initial methods of the first program 120 and the second program 121, and among the extracted initial methods, a method common to the first program 120 and the second program 121 is stored in the target method table 113. Store. In other words, the target method table 113 stores a method common to the first program 120 and the second program 121 in the target method table 113, thereby measuring the method (measurement target method) for measuring the start time and the end time as the target method. Store in the table 113 (140).
 ステップ140の後、制御部106は、対象メソッドテーブル113に格納された測定対象メソッドの実行時間を測定する(150)。ステップ150の後、制御部106は、ステップ150の測定結果に基づいて、性能差要因メソッドを抽出する(160)。 After step 140, the control unit 106 measures the execution time of the measurement target method stored in the target method table 113 (150). After step 150, the control unit 106 extracts a performance difference factor method based on the measurement result of step 150 (160).
 そして制御部106は、ステップ160において性能差要因メソッドが抽出されたか否かを判定する(170)。性能差要因メソッドが抽出されない場合、第1プログラム120と第2プログラム121との間で性能の差がないため、制御部106は処理を終了する。 Then, the control unit 106 determines whether or not a performance difference factor method has been extracted in Step 160 (170). When the performance difference factor method is not extracted, there is no performance difference between the first program 120 and the second program 121, so the control unit 106 ends the process.
 性能差要因メソッドが抽出された場合、制御部106は、性能差要因メソッドによって直接呼ばれたメソッドを対象メソッドテーブル113に格納し、性能差要因メソッドによって直接呼ばれたメソッドをさらに測定させる(180)。これは、性能差要因メソッドによって直接呼ばれるメソッドの中から、最も顕著に性能の差が生じているメソッドを抽出するためである。 When the performance difference factor method is extracted, the control unit 106 stores the method directly called by the performance difference factor method in the target method table 113, and further measures the method directly called by the performance difference factor method (180). ). This is because the method in which the performance difference is most noticeable is extracted from the methods directly called by the performance difference factor method.
 ステップ180の後、制御部106は、ステップ150に戻る。その後、ステップ170において性能差要因メソッドが抽出されないと判定された場合、測定対象メソッドを呼んだ呼出元メソッドにおいて、最も性能の差が生じていることを示すため、制御部106は、処理を終了する。 After step 180, the control unit 106 returns to step 150. Thereafter, when it is determined in step 170 that the performance difference factor method is not extracted, the control unit 106 terminates the process to indicate that the performance difference is the greatest in the caller method that called the measurement target method. To do.
 図8は、本発明の第1の実施形態の初期メソッドを示すシーケンス図である。 FIG. 8 is a sequence diagram showing an initial method according to the first embodiment of this invention.
 図8に示すシーケンス図は、スレッドA1071、スレッドB1072、スレッド1073、スレッドD1074、メソッド201~メソッド216の実行時間を示す。 The sequence diagram shown in FIG. 8 shows the execution times of thread A 1071, thread B 1072, thread 1073, thread D 1074, and method 201 to method 216.
 ステップ140は、具体的には、テスト実行部107が第1プログラム120及び第2プログラム121へ特定の入力値を入力し始める時点から、特定の入力値を入力し終える時点までのテスト実行時間中に、第1プログラム120及び第2プログラム121に含まれる各スレッドのコールスタックにおいて、最も上位に格納されるメソッドを抽出する処理である。 Specifically, step 140 is during the test execution time from when the test execution unit 107 starts to input specific input values to the first program 120 and the second program 121 until when the specific input values have been input. In addition, in the call stack of each thread included in the first program 120 and the second program 121, it is a process of extracting the method stored at the highest level.
 図8において、プログラム200は、テスト実行部107が第1プログラム120又は第2プログラム121へ特定の入力値を入力し始める時から、特定の入力値を入力し終える時までに実行される第1プログラム120又は第2プログラム121を示す。 In FIG. 8, the program 200 is executed from the time when the test execution unit 107 starts to input a specific input value to the first program 120 or the second program 121 to the time when the input of the specific input value is finished. The program 120 or the second program 121 is shown.
 プログラム200は、スレッドA1071において実行されるメソッド201を呼ぶ。図8において、プログラム200によって呼ばれるメソッド201は、常に実行されるメソッドであり、プログラム200が開始する前から実行されているメソッドである。このため、メソッド201は、性能の差が生じるメソッドではないため、スレッドA1071における初期メソッドではない。 The program 200 calls the method 201 executed in the thread A 1071. In FIG. 8, a method 201 called by the program 200 is a method that is always executed, and is a method that is being executed before the program 200 is started. For this reason, the method 201 is not an initial method in the thread A 1071 because it is not a method that causes a difference in performance.
 プログラム200によって呼ばれた後、メソッド201は、スレッドB1072において実行されるメソッド203を呼ぶ。図8において、メソッド201によって呼ばれるメソッド203は、プログラム200が開始した後に実行され、プログラム200が終了する前に終了するメソッドである。このため、メソッド203は、スレッドB1072における初期メソッドである。ここで、メソッド203は、スレッドB1072におけるコールスタックの最も上位に格納される。 After being called by the program 200, the method 201 calls the method 203 executed in the thread B1072. In FIG. 8, a method 203 called by the method 201 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 203 is an initial method in the thread B1072. Here, the method 203 is stored at the top of the call stack in the thread B 1072.
 なお、スレッドBにおけるメソッド202及びメソッド209は、いずれもプログラム200が実行される間に実行されるメソッドではなく、性能の差を生じる要因とならないため、初期メソッドではない。 Note that the method 202 and the method 209 in the thread B are not methods executed while the program 200 is executed, and are not initial methods because they do not cause a difference in performance.
 メソッド203は、メソッド203が実行されている間に、メソッド204及びメソッド205を呼ぶ。図8において、メソッド203によって呼ばれるメソッド204及びメソッド205は、プログラム200が開始した後に実行され、プログラム200が終了する前に終了するメソッドである。このため、メソッド204及びメソッド205は、測定対象メソッドとなる可能性があるメソッドである。 The method 203 calls the method 204 and the method 205 while the method 203 is being executed. In FIG. 8, a method 204 and a method 205 called by the method 203 are methods that are executed after the program 200 is started and ended before the program 200 ends. Therefore, the method 204 and the method 205 are methods that may become measurement target methods.
 本実施形態において、初期メソッドであるメソッド203の、コールスタックにおけるフレーム番号が"1"である場合、メソッド204及びメソッド205のフレーム番号は"2"である。 In this embodiment, when the frame number in the call stack of the method 203 as the initial method is “1”, the frame numbers of the method 204 and the method 205 are “2”.
 さらに、メソッド205は、メソッド206及びメソッド207を呼ぶ。ここで、メソッド203のフレーム番号が"1"である場合、メソッド206及びメソッド207の、コールスタックにおけるフレーム番号は"3"である。 Furthermore, the method 205 calls a method 206 and a method 207. Here, when the frame number of the method 203 is “1”, the frame number in the call stack of the method 206 and the method 207 is “3”.
 さらに、メソッド207はメソッド208を呼ぶ。ここで、メソッド203のフレーム番号が"1"である場合、コールスタックにおけるメソッド208のフレーム番号は"4"である。 Furthermore, method 207 calls method 208. Here, when the frame number of the method 203 is “1”, the frame number of the method 208 in the call stack is “4”.
 図8において、メソッド204、メソッド205、メソッド206、メソッド207及びメソッド208は、プログラム200が開始した後に実行され、プログラム200が終了する前に終了するメソッドである。このため、メソッド204、メソッド205、メソッド206、メソッド207及びメソッド208は、測定対象メソッドとなる可能性があるメソッドである。 In FIG. 8, a method 204, a method 205, a method 206, a method 207, and a method 208 are methods that are executed after the program 200 starts and end before the program 200 ends. Therefore, the method 204, the method 205, the method 206, the method 207, and the method 208 are methods that may become measurement target methods.
 メソッド204は、スレッドC1073におけるメソッド210を呼ぶ。図8において、メソッド204によって呼ばれるメソッド210は、プログラム200が終了した後も実行されるメソッドである。このため、メソッド210は、性能の差を生じる要因とならないため、スレッドC1073における初期メソッドではない。 Method 204 calls method 210 in thread C1073. In FIG. 8, a method 210 called by the method 204 is a method that is executed even after the program 200 ends. For this reason, the method 210 does not cause a difference in performance, and thus is not an initial method in the thread C1073.
 メソッド210は、メソッド211を呼ぶ。図8において、メソッド210によって呼ばれるメソッド211は、プログラム200が開始した後に実行され、プログラム200が終了する前に終了するメソッドである。このため、メソッド211は、スレッドC1073における初期メソッドである。ここで、メソッド211は、スレッドC1073におけるコールスタックの上位に格納される。この時、スレッドC1073のコールスタックには、メソッド210が既に格納されているため、メソッド211のフレーム番号は"2"である。 Method 210 calls method 211. In FIG. 8, a method 211 called by the method 210 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 211 is an initial method in the thread C1073. Here, the method 211 is stored above the call stack in the thread C1073. At this time, since the method 210 has already been stored in the call stack of the thread C1073, the frame number of the method 211 is “2”.
 さらに、メソッド211はメソッド212を呼ぶ。ここで、メソッド211のフレーム番号が"2"である場合、メソッド212のコールスタックにおけるフレーム番号は"3"である。 Furthermore, method 211 calls method 212. Here, when the frame number of the method 211 is “2”, the frame number in the call stack of the method 212 is “3”.
 図8において、メソッド212は、プログラム200が開始した後に実行され、プログラム200が終了する前に終了するメソッドである。このため、メソッド212は、測定対象メソッドとなる可能性があるメソッドである。 Referring to FIG. 8, a method 212 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 212 is a method that may be a measurement target method.
 メソッド211は、スレッドD1074におけるメソッド214を呼ぶ。図8において、メソッド211によって呼ばれるメソッド214は、プログラム200が開始する前から実行されているメソッドである。このため、メソッド214は、性能の差を生じる要因とならないため、スレッドD1074における初期メソッドではない。 Method 211 calls method 214 in thread D1074. In FIG. 8, a method 214 called by a method 211 is a method that is being executed before the program 200 is started. For this reason, the method 214 does not cause a difference in performance, and thus is not an initial method in the thread D1074.
 メソッド214は、メソッド216を呼ぶ。図8において、メソッド214によって呼ばれるメソッド216は、プログラム200が開始した後に実行され、プログラム200が終了する前に終了するメソッドである。このためメソッド216は、初期メソッドである。ここで、スレッドD1074のコールスタックには、メソッド213及びメソッド214が既に格納されているため、メソッド216のフレーム番号は"3"である。 Method 214 calls method 216. In FIG. 8, a method 216 called by the method 214 is a method that is executed after the program 200 starts and ends before the program 200 ends. Therefore, the method 216 is an initial method. Here, since the method 213 and the method 214 are already stored in the call stack of the thread D1074, the frame number of the method 216 is “3”.
 スレッドD1074のメソッド215は、メソッド216及びメソッド214が終了した後に実行され、プログラム200が終了する前に終了するメソッドである。このため、性能の差を生じる要因となるため、初期メソッドとなる。ここで、スレッドD1074のコールスタックには、メソッド213が既に格納されているため、メソッド216のフレーム番号は"2"である。 The method 215 of the thread D 1074 is a method that is executed after the method 216 and the method 214 are finished, and is finished before the program 200 is finished. For this reason, it becomes a factor that causes a difference in performance, and thus becomes an initial method. Here, since the method 213 is already stored in the call stack of the thread D1074, the frame number of the method 216 is “2”.
 本実施形態の制御部106は、前述の初期メソッドをステップ140において抽出する。 The control unit 106 of the present embodiment extracts the initial method described above in step 140.
 図9は、本発明の第1の実施形態の初期メソッドを抽出する処理におけるデータの流れを示すブロック図である。 FIG. 9 is a block diagram illustrating a data flow in the process of extracting the initial method according to the first embodiment of this invention.
 図9に示す矢印は、図7に示すステップ140におけるデータの流れを示し、図10A、図10B、及び、図10Cに示す処理に対応する。 The arrows shown in FIG. 9 indicate the data flow in step 140 shown in FIG. 7, and correspond to the processing shown in FIGS. 10A, 10B, and 10C.
 図10Aは、本発明の第1の実施形態の初期メソッドを抽出するためにテストを実行する処理を示すフローチャートである。 FIG. 10A is a flowchart showing a process for executing a test to extract an initial method according to the first embodiment of this invention.
 図10Aに示す処理は、図7に示すステップ140に含まれる処理である。まず、第1プログラム120をテストが可能な状態にする指示を制御部106から受信した後、バージョン切替部110は、第1プログラム120を実行可能な状態に切り替え、その後、切り替えの終了を制御部106に通知する(1401)。 The process shown in FIG. 10A is a process included in step 140 shown in FIG. First, after receiving an instruction from the control unit 106 to set the first program 120 in a testable state, the version switching unit 110 switches the first program 120 to a state in which the first program 120 can be executed. 106 is notified (1401).
 ステップ1401の後、制御部106は、テスト実行中フラグに"TRUE"を格納する指示を初期メソッド記録部117に送信する。初期メソッド記録部117は、テスト実行中フラグに"TRUE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"TRUE"を格納する(1402)。なお、初期メソッド記録部117は、メモリ102の中に、テスト実行中フラグを示す領域をあらかじめ保持する。 After step 1401, the control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the initial method recording unit 117. After receiving an instruction to store “TRUE” in the test execution flag from the control unit 106, the initial method recording unit 117 stores “TRUE” in the test execution flag (1402). Note that the initial method recording unit 117 holds an area indicating the test execution flag in the memory 102 in advance.
 テスト実行中フラグに"TRUE"が格納される場合、テスト実行中フラグは、テスト実行部107がプログラムをテストしていることを示す。テスト実行中フラグに"FALSE"が格納される場合、テスト実行中フラグは、テスト実行部107がプログラムをテストしていないことを示す。 When “TRUE” is stored in the test execution flag, the test execution flag indicates that the test execution unit 107 is testing the program. When “FALSE” is stored in the test execution flag, the test execution flag indicates that the test execution unit 107 has not tested the program.
 ステップ1402の後、制御部106は、第1プログラム120のテストを開始する指示をテスト実行部107に送信する。テスト実行部107は、第1プログラム120のテストを開始する指示を制御部106から受信すると、第1プログラム120のテストを開始する(1403)。 After step 1402, the control unit 106 transmits an instruction to start the test of the first program 120 to the test execution unit 107. When the test execution unit 107 receives an instruction to start the test of the first program 120 from the control unit 106, the test execution unit 107 starts the test of the first program 120 (1403).
 ステップ1403の後、テスト実行部107は、テストを実行するため、あらかじめユーザによって指定された所定の入力値を第1プログラム120に入力する(1404)。ステップ1404の後、テスト実行部107は、第1プログラム120のテストを終了し、その後、テストの終了を制御部106に通知する(1405)。 After step 1403, the test execution unit 107 inputs a predetermined input value designated in advance by the user to the first program 120 in order to execute the test (1404). After step 1404, the test execution unit 107 ends the test of the first program 120, and then notifies the control unit 106 of the end of the test (1405).
 ステップ1405の後、制御部106は、テスト実行中フラグに"FALSE"を格納する指示を初期メソッド記録部117に送信する。初期メソッド記録部117は、テスト実行中フラグに"FALSE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"FALSE"を格納する(1406)。 After step 1405, the control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the initial method recording unit 117. The initial method recording unit 117 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1406).
 ステップ1406の後、制御部106は、第1プログラム120を終了させる指示をバージョン切替部110に送信する(1407)。 After step 1406, the control unit 106 transmits an instruction to end the first program 120 to the version switching unit 110 (1407).
 テスト実行中フラグに"FALSE"を格納した後、初期メソッド記録部117は、スレッドごとのコールスタック(以下、メソッド情報スタックと記載)のうち、終了済みフラグが付加されているメソッドを抽出し、抽出されたメソッドを示す情報を、第1メソッド呼出テーブル111に格納する(1409)。終了済みフラグは、後述する図10Cに示す処理において更新される記憶領域である。 After storing “FALSE” in the test execution flag, the initial method recording unit 117 extracts a method to which a completed flag is added from a call stack for each thread (hereinafter referred to as a method information stack). Information indicating the extracted method is stored in the first method call table 111 (1409). The completed flag is a storage area that is updated in the process shown in FIG.
 そして、初期メソッド記録部117は、すべてのスレッドのメソッド情報スタックについて、ステップ1409を繰り返す(1408)。 The initial method recording unit 117 repeats Step 1409 for the method information stack of all threads (1408).
 ステップ1408が終了した後、バージョン切替部110は、第2プログラム121をテストが可能な状態にする指示を制御部106から受信する。その後、バージョン切替部110は、第2プログラム121を実行可能な状態に切り替え、その後、切り替えの終了を制御部106に通知する(1410)。 After step 1408 is completed, the version switching unit 110 receives an instruction from the control unit 106 to make the second program 121 ready for testing. Thereafter, the version switching unit 110 switches the second program 121 to an executable state, and then notifies the control unit 106 of the end of the switching (1410).
 ステップ1410の後、制御部106は、テスト実行中フラグに"TRUE"を格納する指示を初期メソッド記録部117に送信する。初期メソッド記録部117は、テスト実行中フラグに"TRUE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"TRUE"を格納する(1411)。 After step 1410, the control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the initial method recording unit 117. The initial method recording unit 117 stores an instruction to store “TRUE” in the test execution flag from the control unit 106, and then stores “TRUE” in the test execution flag (1411).
 ステップ1411の後、制御部106は、第2プログラム121のテストを開始する指示をテスト実行部107に送信する。テスト実行部107は、第2プログラム121のテストを開始する指示を制御部106から受信すると、第2プログラム121のテストを開始する(1412)。 After step 1411, the control unit 106 transmits an instruction to start the test of the second program 121 to the test execution unit 107. When the test execution unit 107 receives an instruction to start the test of the second program 121 from the control unit 106, the test execution unit 107 starts the test of the second program 121 (1412).
 ステップ1412の後、テスト実行部107は、テストを実行するため、あらかじめユーザによって指定された所定の値を第2プログラム121に入力する(1413)。ステップ1413の後、テスト実行部107は、第2プログラム121のテストを終了し、その後、テストの終了を制御部106に通知する(1414)。 After step 1412, the test execution unit 107 inputs a predetermined value designated in advance by the user to the second program 121 in order to execute the test (1413). After step 1413, the test execution unit 107 ends the test of the second program 121, and then notifies the control unit 106 of the end of the test (1414).
 ステップ1414の後、制御部106は、テスト実行中フラグに"FALSE"を格納する指示を初期メソッド記録部117に送信する。初期メソッド記録部117は、テスト実行中フラグに"FALSE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"FALSE"を格納する(1415)。 After step 1414, the control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the initial method recording unit 117. The initial method recording unit 117 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1415).
 ステップ1415の後、制御部106は、第2プログラム121を終了させる指示をバージョン切替部110に送信する(1416)。 After step 1415, the control unit 106 transmits an instruction to end the second program 121 to the version switching unit 110 (1416).
 テスト実行中フラグに"FALSE"を格納した後、初期メソッド記録部117は、スレッドごとのメソッド情報スタックのうち、対応する終了済みフラグが生成されているメソッドを抽出し、抽出されたメソッドを示す情報を、第1メソッド呼出テーブル111に格納する(1418)。 After storing “FALSE” in the test execution flag, the initial method recording unit 117 extracts the method for which the corresponding completed flag is generated from the method information stack for each thread, and indicates the extracted method. The information is stored in the first method call table 111 (1418).
 そして、初期メソッド記録部117は、すべてのスレッドのメソッド情報スタックについて、ステップ1418を繰り返す(1417)。 Then, the initial method recording unit 117 repeats Step 1418 for the method information stack of all threads (1417).
 ステップ1417の後、制御部106は、測定対象メソッドを抽出し(1419)、図10Aに示す処理を終了する。 After step 1417, the control unit 106 extracts a measurement target method (1419), and ends the process illustrated in FIG. 10A.
 図10Bは、本発明の第1の実施形態の測定対象メソッドを抽出する処理を示すフローチャートである。 FIG. 10B is a flowchart showing a process of extracting a measurement target method according to the first embodiment of this invention.
 図10Bに示す処理は、図10Aに示すステップ1419に相当する。 The process shown in FIG. 10B corresponds to step 1419 shown in FIG. 10A.
 制御部106は、図10Aのステップ1417が終了した後、測定対象メソッドを抽出する指示をメソッド呼出照合部108に送信する(1420)。測定対象メソッドを抽出する指示をメソッド呼出照合部108から受信した後、メソッド呼出照合部108は、第1メソッド呼出テーブル111に格納される情報を読み込む(1421)。また、メソッド呼出照合部108は、第2メソッド呼出テーブル112に格納される情報を読み込む(1422)。 The control unit 106 transmits an instruction to extract the measurement target method to the method call matching unit 108 after step 1417 in FIG. 10A is completed (1420). After receiving the instruction to extract the measurement target method from the method call matching unit 108, the method call matching unit 108 reads information stored in the first method call table 111 (1421). Further, the method call matching unit 108 reads information stored in the second method call table 112 (1422).
 ステップ1421及びステップ1422の後、メソッド呼出照合部108は、新たな測定対象メソッドを対象メソッドテーブル113に格納するため、対象メソッドテーブル113に格納されていたデータを削除する(1423)。ステップ1423の後、メソッド呼出照合部108は、第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112から読み込んだ情報に基づいて、第1メソッド呼出テーブル111と第2メソッド呼出テーブル112とに共通して格納されるメソッドを抽出し、抽出されたメソッドを対象メソッドテーブル113に格納する(1424)。 After step 1421 and step 1422, the method call matching unit 108 deletes the data stored in the target method table 113 in order to store the new measurement target method in the target method table 113 (1423). After step 1423, the method call verification unit 108 is common to the first method call table 111 and the second method call table 112 based on the information read from the first method call table 111 and the second method call table 112. The extracted method is extracted, and the extracted method is stored in the target method table 113 (1424).
 ステップ1424の後、メソッド呼出照合部108は、制御部に測定対象メソッドの抽出の終了を通知し、ステップ1419の処理を終了する(1425)。 After step 1424, the method call matching unit 108 notifies the control unit of the end of extraction of the measurement target method, and ends the process of step 1419 (1425).
 ステップ1419の処理によって、第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112に共通して格納されたメソッドが測定対象メソッドとして抽出される。 By the processing in step 1419, the methods stored in common in the first method call table 111 and the second method call table 112 are extracted as measurement target methods.
 図10Cは、本発明の第1の実施形態の初期メソッドを抽出する処理を示すフローチャートである。 FIG. 10C is a flowchart showing processing for extracting an initial method according to the first embodiment of this invention.
 図10Cに示す処理は、図10Aに示すテストの実行中に、各プログラムから呼ばれるメソッドの中から初期メソッドを抽出するための処理である。 The process shown in FIG. 10C is a process for extracting an initial method from methods called by each program during the execution of the test shown in FIG. 10A.
 コールバック受信部119は、JVMTI123からコールバックを受信し、コールバックが受信された時刻と、コールバックに含まれる各情報を初期メソッド記録部117に送信する。コールバックには、前述の通り、メソッドを示す情報(クラス名、メソッド名、メソッド識別子、呼び出し元のメソッドを示す情報、及び、コールスタックにおけるフレーム番号など)と、メソッドが開始されたか終了したかを示す情報とが含まれる。 The callback receiving unit 119 receives the callback from the JVMTI 123, and transmits the time when the callback is received and each information included in the callback to the initial method recording unit 117. As described above, the callback includes information indicating the method (class name, method name, method identifier, information indicating the calling method, frame number in the call stack, etc.), and whether the method has started or ended. Is included.
 ステップ1430の後、初期メソッド記録部117は、テスト実行中フラグに"TRUE"が格納されているか否かを判定する(1431)。テスト実行中フラグに"FALSE"が格納されている場合、テストが実行されておらず、初期メソッドを抽出する必要がないため、初期メソッド記録部117はステップ1438に移行する。 After step 1430, the initial method recording unit 117 determines whether “TRUE” is stored in the test execution flag (1431). If “FALSE” is stored in the test execution flag, the test has not been executed and it is not necessary to extract the initial method, so the initial method recording unit 117 proceeds to step 1438.
 テスト実行中フラグに"TRUE"が格納されている場合、初期メソッド記録部117は、受信されたコールバックに含まれる情報に基づいて、メソッドが開始されたか終了したかを判定する(1432)。 When “TRUE” is stored in the test execution flag, the initial method recording unit 117 determines whether the method is started or ended based on the information included in the received callback (1432).
 メソッドが開始されたと判定された場合、スレッド毎のメソッド情報スタックにコールバックに含まれるメソッドを示す情報を格納する(PUSH)(1433)。ステップ1433によって、メソッド情報スタックに格納されたメソッドは、初期メソッドの候補になる。 When it is determined that the method is started, information indicating the method included in the callback is stored in the method information stack for each thread (PUSH) (1433). In step 1433, the method stored in the method information stack becomes an initial method candidate.
 ステップ1432においてメソッドが終了したと判定された場合、初期メソッド記録部117は、コールバックに含まれるメソッドの情報が、既にメソッド情報スタックのうちのいずれかに格納されているか否かを判定する(1434)。ステップ1434の判定によって、コールバックが示すメソッドが、テストが実行されている間に開始されたメソッドであるか否かを判定できる。なお、前述の通り、初期メソッドは、テストが実行されている間に、開始され、終了したメソッドである。 If it is determined in step 1432 that the method has ended, the initial method recording unit 117 determines whether or not the method information included in the callback is already stored in any of the method information stacks ( 1434). The determination in step 1434 can determine whether or not the method indicated by the callback is a method started while the test is being executed. As described above, the initial method is a method that is started and ended while the test is being executed.
 ステップ1434において、コールバックに含まれるメソッドの情報が、メソッド情報スタックのいずれにも格納されていないと判定された場合、コールバックが示すメソッドは、テストが実行されている間に開始されていないメソッドであり、初期メソッドにはならないため、初期メソッド記録部117は、ステップ1439に移行する。 If it is determined in step 1434 that the method information included in the callback is not stored in any of the method information stacks, the method indicated by the callback is not started while the test is being executed. Since it is a method and not an initial method, the initial method recording unit 117 proceeds to Step 1439.
 ステップ1434において、コールバックに含まれるメソッドの情報が、メソッド情報スタックのうちのいずれかに格納されていると判定された場合、コールバックが示すメソッドは、テストが実行されている間に開始されたメソッドであり、初期メソッドになる可能性があるメソッドである。このため初期メソッド記録部117は、ステップ1434の後、ステップ1435に移行する。 If it is determined in step 1434 that the method information included in the callback is stored in any of the method information stacks, the method indicated by the callback is started while the test is being executed. It is a method that can be an initial method. Therefore, the initial method recording unit 117 proceeds to step 1435 after step 1434.
 初期メソッド記録部117は、ステップ1434においてコールバックに含まれるメソッドの情報が格納されていると判定されたメソッド情報スタックの、最も下位に格納されたメソッドを取得する(POP)。そして、取得されたメソッドを示す情報を、先頭のメソッド情報に格納する(1435)。先頭のメソッド情報は、メソッドを示す情報を一時的に格納するための記憶領域であり、初期メソッド記録部117によってあらかじめ保持される。 The initial method recording unit 117 obtains the method stored at the lowest level of the method information stack determined in step 1434 that the method information included in the callback is stored (POP). Then, information indicating the acquired method is stored in the first method information (1435). The first method information is a storage area for temporarily storing information indicating a method, and is held in advance by the initial method recording unit 117.
 ステップ1435の後、初期メソッド記録部117は、先頭のメソッド情報が、コールバックに含まれるメソッドを示す情報と同じであるか否かを判定する(1436)。先頭のメソッド情報が、コールバックに含まれるメソッドを示す情報と異なる場合、先頭のメソッド情報に格納されたメソッドは、コールバックに含まれるメソッドよりも下位のメソッドである。このため、初期メソッド記録部117は、さらに上位のメソッドを先頭のメソッド情報に格納するため、ステップ1435に戻る。 After step 1435, the initial method recording unit 117 determines whether or not the top method information is the same as the information indicating the method included in the callback (1436). When the head method information is different from the information indicating the method included in the callback, the method stored in the head method information is a lower-level method than the method included in the callback. Therefore, the initial method recording unit 117 returns to step 1435 in order to store a higher-order method in the top method information.
 ステップ1436において、先頭のメソッド情報が、コールバックに含まれるメソッドを示す情報と同じである場合、初期メソッド記録部117は、先頭のメソッド情報に対応する終了済みフラグを生成する(1437)。終了済みフラグが対応して生成されている場合、先頭のメソッド情報が示すメソッドは、終了していることを示す。 In step 1436, when the head method information is the same as the information indicating the method included in the callback, the initial method recording unit 117 generates a completed flag corresponding to the head method information (1437). When the completed flag is generated correspondingly, the method indicated by the first method information indicates that it has been completed.
 ステップ1437の後、初期メソッド記録部117は、先頭のメソッド情報に格納されるメソッド情報を、ステップ1435において取得されたメソッド情報スタックに再度格納(PUSH)する(1438)。 After step 1437, the initial method recording unit 117 stores (PUSH) again the method information stored in the head method information in the method information stack acquired in step 1435 (1438).
 ステップ1438の処理によって、メソッド情報スタックのうち最も下位には、終了済みのメソッドが格納される。また、図10Cに示す処理が、コールバックが発行された都度実行されることによって、テスト実行中に開始され、終了したメソッドのうち、最も上位のメソッドがメソッド情報スタックに残る。このため、テストが終了した後において、メソッド情報スタックに格納され、対応する終了済みフラグが生成されているメソッドは、初期メソッドである。 By the processing of step 1438, the finished method is stored at the lowest position in the method information stack. Also, the process shown in FIG. 10C is executed each time a callback is issued, so that the highest method among the methods started and ended during the test execution remains in the method information stack. For this reason, after the test is finished, the method that is stored in the method information stack and the corresponding finished flag is generated is the initial method.
 ステップ1438の後、初期メソッド記録部117は、図10Cの処理を終了し、コールバック受信部119に処理の終了を通知する(1439)。 After step 1438, the initial method recording unit 117 ends the process of FIG. 10C and notifies the callback receiving unit 119 of the end of the process (1439).
 図10Cに示す処理によってメソッド情報スタックに初期メソッドが格納された後、図10Aに示すステップ1409及びステップ1418によって、初期メソッド記録部117は、スレッドごとのメソッド情報スタックのうち、終了済みフラグが生成されているメソッドを、第1メソッド呼出テーブル111又は第2メソッド呼出テーブル112に格納する。これによって、第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112に初期メソッドが格納される。 After the initial method is stored in the method information stack by the process shown in FIG. 10C, the initial method recording unit 117 generates a completed flag in the method information stack for each thread in steps 1409 and 1418 shown in FIG. 10A. The stored method is stored in the first method call table 111 or the second method call table 112. As a result, the initial method is stored in the first method call table 111 and the second method call table 112.
 図11は、本発明の第1の実施形態の測定対象メソッドの実行時間を測定する処理におけるデータの流れを示すブロック図である。 FIG. 11 is a block diagram illustrating a data flow in the process of measuring the execution time of the measurement target method according to the first embodiment of this invention.
 図11に示す矢印は、図7に示すステップ150におけるデータの流れを示し、図12A、及び、図12Bに示す処理に対応する。 The arrows shown in FIG. 11 indicate the data flow in step 150 shown in FIG. 7, and correspond to the processing shown in FIGS. 12A and 12B.
 図12Aは、本発明の第1の実施形態の実行時間を測定するためにテストを実行する処理を示すフローチャートである。 FIG. 12A is a flowchart illustrating a process for executing a test to measure the execution time according to the first embodiment of this invention.
 図12Aに示す処理は、図7に示すステップ150に含まれる処理である。まず、第1プログラム120をテストが可能な状態にする指示を制御部106から受信した後、バージョン切替部110は、第1プログラム120を実行可能な状態に切り替え、その後、切り替えの終了を制御部106に通知する(1501)。 The process shown in FIG. 12A is a process included in step 150 shown in FIG. First, after receiving an instruction from the control unit 106 to set the first program 120 in a testable state, the version switching unit 110 switches the first program 120 to a state in which the first program 120 can be executed. 106 is notified (1501).
 ステップ1501の後、制御部106は、テスト実行中フラグに"TRUE"を格納する指示を対象メソッド記録部118に送信する。対象メソッド記録部118は、テスト実行中フラグに"TRUE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"TRUE"を格納する(1502)。 After step 1501, the control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the target method recording unit 118. The target method recording unit 118 receives an instruction to store “TRUE” in the test execution flag from the control unit 106, and then stores “TRUE” in the test execution flag (1502).
 なお、対象メソッド記録部118は、メモリ102の中に、テスト実行中フラグを示す領域をあらかじめ保持する。初期メソッド記録部117が保持するテスト実行中フラグと対象メソッド記録部118が保持するテスト実行中フラグは、同じ領域に格納されてもよい。 Note that the target method recording unit 118 holds an area indicating the test execution flag in the memory 102 in advance. The test execution flag held by the initial method recording unit 117 and the test execution flag held by the target method recording unit 118 may be stored in the same area.
 ステップ1502の後、制御部106は、第1プログラム120のテストを開始する指示をテスト実行部107に送信する。テスト実行部107は、第1プログラム120のテストを開始する指示を制御部106から受信すると、第1プログラム120のテストを開始する(1503)。 After step 1502, the control unit 106 transmits an instruction to start the test of the first program 120 to the test execution unit 107. When the test execution unit 107 receives an instruction to start the test of the first program 120 from the control unit 106, the test execution unit 107 starts the test of the first program 120 (1503).
 ステップ1503の後、テスト実行部107は、テストを実行するため、あらかじめユーザによって指定された所定の値を第1プログラム120に入力する(1504)。ステップ1504の後、テスト実行部107は、第1プログラム120のテストを終了し、その後、テストの終了を制御部106に通知する(1505)。 After step 1503, the test execution unit 107 inputs a predetermined value designated in advance by the user to the first program 120 in order to execute the test (1504). After step 1504, the test execution unit 107 ends the test of the first program 120, and then notifies the control unit 106 of the end of the test (1505).
 ステップ1505の後、制御部106は、テスト実行中フラグに"FALSE"を格納する指示を対象メソッド記録部118に送信する。対象メソッド記録部118は、テスト実行中フラグに"FALSE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"FALSE"を格納する(1506)。 After step 1505, the control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the target method recording unit 118. The target method recording unit 118 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1506).
 ステップ1506の後、制御部106は、第1プログラム120を終了させる指示をバージョン切替部110に送信する(1507)。 After step 1506, the control unit 106 transmits an instruction to end the first program 120 to the version switching unit 110 (1507).
 ステップ1507の後、バージョン切替部110は、第2プログラム121をテストが可能な状態にする指示を制御部106から受信する。その後、バージョン切替部110は、第2プログラム121を実行可能な状態に切り替え、その後、切り替えの終了を制御部106に通知する(1508)。 After step 1507, the version switching unit 110 receives an instruction from the control unit 106 to make the second program 121 ready for testing. Thereafter, the version switching unit 110 switches the second program 121 to an executable state, and then notifies the control unit 106 of the end of the switching (1508).
 ステップ1508の後、制御部106は、テスト実行中フラグに"TRUE"を格納する指示を対象メソッド記録部118に送信する。対象メソッド記録部118は、テスト実行中フラグに"TRUE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"TRUE"を格納する(1509)。 After step 1508, the control unit 106 transmits an instruction to store “TRUE” in the test execution flag to the target method recording unit 118. The target method recording unit 118 receives an instruction to store “TRUE” in the test execution flag from the control unit 106, and then stores “TRUE” in the test execution flag (1509).
 ステップ1509の後、制御部106は、第2プログラム121のテストを開始する指示をテスト実行部107に送信する。テスト実行部107は、第2プログラム121のテストを開始する指示を制御部106から受信すると、第2プログラム121のテストを開始する(1510)。 After step 1509, the control unit 106 transmits an instruction to start the test of the second program 121 to the test execution unit 107. When the test execution unit 107 receives an instruction to start the test of the second program 121 from the control unit 106, the test execution unit 107 starts the test of the second program 121 (1510).
 ステップ1510の後、テスト実行部107は、テストを実行するため、あらかじめユーザによって指定された所定の値を第2プログラム121に入力する(1511)。ステップ1511の後、テスト実行部107は、第2プログラム121のテストを終了し、その後、テストの終了を制御部106に通知する(1512)。 After step 1510, the test execution unit 107 inputs a predetermined value designated in advance by the user to the second program 121 in order to execute the test (1511). After step 1511, the test execution unit 107 ends the test of the second program 121, and then notifies the control unit 106 of the end of the test (1512).
 ステップ1512の後、制御部106は、テスト実行中フラグに"FALSE"を格納する指示を対象メソッド記録部118に送信する。対象メソッド記録部118は、テスト実行中フラグに"FALSE"を格納する指示を制御部106から受信した後、テスト実行中フラグに"FALSE"を格納する(1513)。 After step 1512, the control unit 106 transmits an instruction to store “FALSE” in the test execution flag to the target method recording unit 118. The target method recording unit 118 receives an instruction to store “FALSE” in the test execution flag from the control unit 106, and then stores “FALSE” in the test execution flag (1513).
 ステップ1513の後、制御部106は、第2プログラム121を終了させる指示をバージョン切替部110に送信し(1514)、図12Aに示す処理を終了する。 After step 1513, the control unit 106 transmits an instruction to end the second program 121 to the version switching unit 110 (1514), and ends the process illustrated in FIG. 12A.
 図12Bは、本発明の第1の実施形態の測定対象メソッドの実行時間を測定する処理を示すフローチャートである。 FIG. 12B is a flowchart illustrating processing for measuring the execution time of the measurement target method according to the first embodiment of this invention.
 図12Bに示す処理は、第1プログラム120が実行された際の測定対象メソッドの実行時間を測定する処理を示す。なお、第2プログラム121が実行された際の測定対象メソッドの実行時間を測定する処理は、図12Bに示す処理に含まれる、第1プログラム120を第2プログラム121に変更し、第1メソッド呼出テーブル111を第2メソッド呼出テーブル112に変更し、第1実行情報テーブル114を第2実行情報テーブル115に変更した処理である。 The process shown in FIG. 12B shows the process of measuring the execution time of the measurement target method when the first program 120 is executed. The process for measuring the execution time of the measurement target method when the second program 121 is executed is performed by changing the first program 120 to the second program 121 included in the process shown in FIG. This is a process in which the table 111 is changed to the second method call table 112 and the first execution information table 114 is changed to the second execution information table 115.
 まず、コールバック受信部119は、第1プログラム120のテストを実行中に、JVMTI123からコールバックを受信し、コールバックが受信された時刻と、コールバックに含まれる各情報を対象メソッド記録部118に送信する(1514)。 First, the callback receiving unit 119 receives a callback from the JVMTI 123 during execution of the test of the first program 120, and records the time when the callback is received and each piece of information included in the callback as the target method recording unit 118. (1514).
 対象メソッド記録部118は、テスト実行中フラグに"TRUE"が格納されているか否かを判定する(1515)。テスト実行中フラグに"FALSE"が格納されている場合、テストが実行されていないため、実行時間を測定できないため、対象メソッド記録部118はステップ1526に移行し、コールバック受信部119に処理の終了を通知する。 The target method recording unit 118 determines whether “TRUE” is stored in the test execution flag (1515). When “FALSE” is stored in the test execution flag, since the test is not executed and the execution time cannot be measured, the target method recording unit 118 proceeds to step 1526 and the callback reception unit 119 performs processing. Notify the end.
 なお、テスト実行中フラグには、第1プログラム120又は第2プログラム121のいずれがテストされているかを示す情報が付加されてもよく、対象メソッド記録部118は、テスト実行中フラグを参照することによって、第1実行情報テーブル114及び第1メソッド呼出テーブル111を用いて処理するか、第2実行情報テーブル115及び第2メソッド呼出テーブル112を用いて処理するかを判定してもよい。 Information indicating which of the first program 120 or the second program 121 is being tested may be added to the test execution flag, and the target method recording unit 118 refers to the test execution flag. Thus, it may be determined whether processing is performed using the first execution information table 114 and the first method call table 111 or processing is performed using the second execution information table 115 and the second method call table 112.
 テスト実行中フラグに"TRUE"が格納されている場合、対象メソッド記録部118は、コールバックが示すメソッドが実行されたスレッドのメソッド実行中フラグに"FALSE"が格納されているか否かを判定する(1516)。 When “TRUE” is stored in the test execution flag, the target method recording unit 118 determines whether “FALSE” is stored in the method execution flag of the thread in which the method indicated by the callback is executed. (1516).
 メソッド実行中フラグは、対象メソッド記録部118によってあらかじめ保持される記憶領域である。あるスレッドのメソッド実行中フラグに"FALSE"が格納される場合、そのスレッドにおいて測定対象メソッドが実行されていないことを示し、あるスレッドのメソッド実行中フラグに"TRUE"が格納される場合、そのスレッドにおいて測定対象メソッドが実行されていることを示す。メソッド実行中フラグは、後述するステップ1519、及び、ステップ1522において更新される。 The method executing flag is a storage area that is held in advance by the target method recording unit 118. When “FALSE” is stored in the method execution flag of a thread, it indicates that the measurement target method is not executed in the thread. When “TRUE” is stored in the method execution flag of a thread, Indicates that the measurement target method is being executed in the thread. The method executing flag is updated in step 1519 and step 1522 described later.
 なお、対象メソッド記録部118は、メソッドが実行されるスレッドを、コールバックに含まれるメソッドを示す情報から取得してもよい。 Note that the target method recording unit 118 may acquire the thread in which the method is executed from information indicating the method included in the callback.
 ステップ1516において、メソッドが実行されるスレッドのメソッド実行中フラグに"FALSE"が格納されていると判定された場合、ステップ1514において受信されたコールバックはメソッドの開始を示すため、対象メソッド記録部118は、開始時刻を格納するためステップ1517に移行する。 If it is determined in step 1516 that “FALSE” is stored in the method execution flag of the thread in which the method is executed, the callback received in step 1514 indicates the start of the method, so that the target method recording unit 118 moves to step 1517 to store the start time.
 ステップ1516の後、対象メソッド記録部118は、コールバックが示すメソッドが、対象メソッドテーブル113に格納されているか否かを判定する(1517)。コールバックが示すメソッドが、対象メソッドテーブル113に格納されていない場合、コールバックが示すメソッドは測定対象メソッドではないため、対象メソッド記録部118は、ステップ1526に移行する。 After step 1516, the target method recording unit 118 determines whether or not the method indicated by the callback is stored in the target method table 113 (1517). If the method indicated by the callback is not stored in the target method table 113, the target method recording unit 118 proceeds to step 1526 because the method indicated by the callback is not a measurement target method.
 ステップ1517において、コールバックが示すメソッドが対象メソッドテーブル113に格納されていると判定された場合、コールバックが示すメソッドは測定対象メソッドであるため、対象メソッド記録部118は、コールバックに含まれるメソッドを示す情報と、コールバックに含まれる時刻(すなわち、メソッドの開始時刻)とを第1実行情報テーブル114に格納する(1518)。 If it is determined in step 1517 that the method indicated by the callback is stored in the target method table 113, the target method recording unit 118 is included in the callback because the method indicated by the callback is the measurement target method. Information indicating the method and the time included in the callback (that is, the start time of the method) are stored in the first execution information table 114 (1518).
 ステップ1518の後、対象メソッド記録部118は、コールバックが示すメソッドが実行されるスレッドのメソッド実行中フラグに、"TRUE"を格納する。また、対象メソッド記録部118は、コールバックに含まれる、メソッドのコールスタックにおけるフレーム番号を、メソッドが実行されるスレッドの測定対象フレームに格納する(1519)。 After step 1518, the target method recording unit 118 stores “TRUE” in the method execution flag of the thread in which the method indicated by the callback is executed. Further, the target method recording unit 118 stores the frame number in the call stack of the method included in the callback in the measurement target frame of the thread in which the method is executed (1519).
 測定対象フレームは、対象メソッド記録部118によって保持される、フレーム番号を一時的に格納するための記憶領域である。測定対象フレームに格納される値は、測定対象メソッドのフレーム番号を示し、スレッドごとに保持される。 The measurement target frame is a storage area for temporarily storing the frame number held by the target method recording unit 118. The value stored in the measurement target frame indicates the frame number of the measurement target method and is held for each thread.
 ステップ1519の後、対象メソッド記録部118は、ステップ1526に移行し、コールバック受信部119に処理の終了を通知する。 After step 1519, the target method recording unit 118 proceeds to step 1526 and notifies the callback receiving unit 119 of the end of processing.
 ステップ1516において、コールバックが示すメソッドが実行されるスレッドのメソッド実行中フラグに"TRUE"が格納されていると判定された場合、ステップ1514において受信されたコールバックはメソッドの終了を示すため、対象メソッド記録部118は、終了時刻を格納するためステップ1520に移行する。 If it is determined in step 1516 that “TRUE” is stored in the method execution flag of the thread in which the method indicated by the callback is executed, the callback received in step 1514 indicates the end of the method. The target method recording unit 118 proceeds to Step 1520 to store the end time.
 対象メソッド記録部118は、ステップ1516の後、コールバックが示すメソッドが実行されるスレッドの測定対象フレームに格納される番号が、コールバックが示すメソッドのフレーム番号と同じか否かを判定する(1520)。 After step 1516, the target method recording unit 118 determines whether the number stored in the measurement target frame of the thread in which the method indicated by the callback is executed is the same as the frame number of the method indicated by the callback ( 1520).
 測定対象フレームに格納される番号が、コールバックが示すメソッドのフレーム番号と同じである場合、コールバックが示すメソッドは、テスト実行中に開始され、ステップ1518において開始時刻を格納されたメソッドである。このため、対象メソッド記録部118は、ステップ1521に移行する。 When the number stored in the measurement target frame is the same as the frame number of the method indicated by the callback, the method indicated by the callback is the method that is started during the execution of the test and the start time is stored in step 1518. . Therefore, the target method recording unit 118 proceeds to Step 1521.
 ステップ1520の後、対象メソッド記録部118は、コールバックに含まれるメソッドを示す情報と、コールバックに含まれる時刻(すなわち、メソッドの終了時刻)とを第1実行情報テーブル114に格納する(1521)。ステップ1521の後、対象メソッド記録部118は、メソッド実行中フラグに"FALSE"を格納する(1522)。 After step 1520, the target method recording unit 118 stores information indicating the method included in the callback and the time included in the callback (that is, the end time of the method) in the first execution information table 114 (1521). ). After step 1521, the target method recording unit 118 stores “FALSE” in the method executing flag (1522).
 ステップ1522の後、対象メソッド記録部118は、ステップ1526に移行し、コールバック受信部119に処理の終了を通知する。 After step 1522, the target method recording unit 118 proceeds to step 1526 and notifies the callback receiving unit 119 of the end of processing.
 ステップ1520において、コールバックが示すメソッドが実行されるスレッドの測定対象フレームに格納される番号が、コールバックが示すメソッドのフレーム番号と異なる場合、コールバックが示すメソッドは、まだ終了していない測定対象メソッドによって呼ばれたメソッド、又は、測定対象メソッドによって呼ばれたメソッドからさらに呼ばれたメソッドである。このため、対象メソッド記録部118は、ステップ1523に移行する。 In step 1520, when the number stored in the measurement target frame of the thread in which the method indicated by the callback is executed is different from the frame number of the method indicated by the callback, the method indicated by the callback is not yet completed. A method called by a target method or a method further called from a method called by a measurement target method. Therefore, the target method recording unit 118 proceeds to Step 1523.
 ステップ1520の後、対象メソッド記録部118は、測定対象フレームに格納される値が、コールバックが示すメソッドのフレーム番号から1を減算した値か否かを判定する。すなわち、コールバックが示すメソッドが、測定対象メソッドによって直接呼ばれたメソッドであるか否かを判定する(1523)。 After step 1520, the target method recording unit 118 determines whether or not the value stored in the measurement target frame is a value obtained by subtracting 1 from the frame number of the method indicated by the callback. That is, it is determined whether or not the method indicated by the callback is a method directly called by the measurement target method (1523).
 測定対象フレームに格納される値が、コールバックが示すメソッドのフレーム番号から1を減算した値ではない場合、コールバックが示すメソッドは次の測定対象メソッドではないため、対象メソッド記録部118は、ステップ1526に移行する。 When the value stored in the measurement target frame is not a value obtained by subtracting 1 from the frame number of the method indicated by the callback, the method indicated by the callback is not the next measurement target method. Control goes to step 1526.
 測定対象フレームに格納される値が、コールバックが示すメソッドのフレーム番号から1を減算した値である場合、対象メソッド記録部118は、コールバックがメソッドの開始を示すか否かを判定する(1524)。ステップ1524において、コールバックがメソッドの開始を示さず、終了を示す場合、対象メソッド記録部118は、ステップ1626に移行する。 When the value stored in the measurement target frame is a value obtained by subtracting 1 from the frame number of the method indicated by the callback, the target method recording unit 118 determines whether or not the callback indicates the start of the method ( 1524). If the callback does not indicate the start of the method but indicates the end in step 1524, the target method recording unit 118 proceeds to step 1626.
 ステップ1524において、コールバックがメソッドの開始を示す場合、コールバックが示すメソッドは次の測定対象メソッドであるため、対象メソッド記録部118は、コールバックに含まれるメソッドを示す情報を、第1メソッド呼出テーブル111に格納する(1525)。 In step 1524, when the callback indicates the start of the method, the method indicated by the callback is the next measurement target method. Therefore, the target method recording unit 118 stores information indicating the method included in the callback as the first method. Store in the call table 111 (1525).
 ここで、第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112に格納された値は、図12Aに示すテストが実行される前に削除されていてもよい。すなわち、ステップ1525によって、次の測定対象メソッドになる可能性があるメソッドのみが第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112に格納されるように、第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112に含まれる前回の初期メソッド又は測定対象メソッドを示す値は、図12Aに示すテスト開始時に削除されてもよい。 Here, the values stored in the first method call table 111 and the second method call table 112 may be deleted before the test shown in FIG. 12A is executed. That is, the first method call table 111 and the second method are stored in the first method call table 111 and the second method call table 112 by the step 1525 so that only methods that may become the next measurement target methods are stored in the first method call table 111 and the second method call table 112. The value indicating the previous initial method or measurement target method included in the call table 112 may be deleted at the start of the test illustrated in FIG. 12A.
 その後、対象メソッド記録部118は、ステップ1526に移行する。 Thereafter, the target method recording unit 118 proceeds to Step 1526.
 ステップ1526において、コールバック受信部119は、次のコールバックの受信まで待機する。 In step 1526, the callback receiver 119 waits until the next callback is received.
 図12Bに示す処理によって、対象メソッド記録部118は、測定対象メソッドの実行時間を測定し、次の測定対象メソッドを抽出する。 12B, the target method recording unit 118 measures the execution time of the measurement target method and extracts the next measurement target method.
 図13は、本発明の第1の実施形態の性能差要因メソッドを抽出する処理を示すフローチャートである。 FIG. 13 is a flowchart showing processing for extracting a performance difference factor method according to the first embodiment of this invention.
 図13に示す処理は、図7に示すステップ160に相当する。ステップ150、すなわち、図12Aに示す処理が行われる毎に、ステップ160は実行される。 The process shown in FIG. 13 corresponds to step 160 shown in FIG. Step 160 is executed each time step 150, that is, the process shown in FIG. 12A is performed.
 制御部106は、性能差要因メソッドを抽出する指示を性能差要因メソッド判定部109に送信する(1601)。 The control unit 106 transmits an instruction to extract the performance difference factor method to the performance difference factor method determination unit 109 (1601).
 性能差要因メソッド判定部109は、性能差要因メソッドを抽出する指示を制御部106から受信した後、変数iと最大性能差要因率とを格納する一時的な記憶領域をメモリ102に保持する。そして、変数iに、1を格納し、最大性能差要因率に、0を格納する(1602)。 The performance difference factor method determination unit 109 receives an instruction to extract a performance difference factor method from the control unit 106, and then holds a temporary storage area in which the variable i and the maximum performance difference factor rate are stored in the memory 102. Then, 1 is stored in the variable i, and 0 is stored in the maximum performance difference factor rate (1602).
 変数iは、対象メソッドテーブル113の行を示すポインタであり、最大性能差要因率は、後述する性能差要因率の最大値を示す。 The variable i is a pointer indicating the row of the target method table 113, and the maximum performance difference factor rate indicates the maximum value of the performance difference factor rate described later.
 ステップ1602の後、性能差要因メソッド判定部109は、ステップ1604からステップ1613までの処理を、変数iに格納された値が対象メソッドテーブル113の行数を超えるまで、繰り返す。 After step 1602, the performance difference factor method determination unit 109 repeats the processing from step 1604 to step 1613 until the value stored in the variable i exceeds the number of rows in the target method table 113.
 ステップ1602の後、性能差要因メソッド判定部109は、第1プログラム120における測定対象メソッドの平均実行時間11631と実行回数11632とを第1実行情報テーブル114に基づいて、算出する。 After step 1602, the performance difference factor method determination unit 109 calculates the average execution time 11631 and the number of executions 11632 of the measurement target method in the first program 120 based on the first execution information table 114.
 具体的には、性能差要因メソッド判定部109は、対象メソッドテーブル113から測定対象メソッドを一つ抽出し、出力装置104のうち、メソッド情報1142の値が測定対象メソッドを示す行を抽出する。そして、抽出された行からさらに、開始終了情報1143が"開始"と"終了"とを各々示す連続した二つの行を抽出する。そして、抽出された二つの行の組の数を算出することによって、実行回数11632を算出する。 Specifically, the performance difference factor method determination unit 109 extracts one measurement target method from the target method table 113, and extracts a line in the output device 104 where the value of the method information 1142 indicates the measurement target method. Then, two consecutive lines whose start / end information 1143 indicates “start” and “end” are extracted from the extracted lines. Then, the number of executions 11632 is calculated by calculating the number of sets of two extracted rows.
 また性能差要因メソッド判定部109は、ステップ1604において、抽出された二つの行の時刻1144の差を算出することによって、1回あたりのメソッドの実行時間を算出する。そして、抽出された二つの行の組の各々の実行時間を算出し、すべての組の実行時間の平均値を算出することによって、平均実行時間11631を算出する。 Further, in step 1604, the performance difference factor method determination unit 109 calculates a method execution time per time by calculating a difference between the times 1144 of the two extracted rows. Then, the average execution time 11631 is calculated by calculating the execution time of each of the two sets of extracted rows and calculating the average value of the execution times of all the sets.
 ステップ1604の後、性能差要因メソッド判定部109は、第2プログラム121における測定対象メソッドの平均実行時間11641と実行回数11642とを第2実行情報テーブル115に基づいて、算出する(1605)。平均実行時間11641と実行回数11642の具体的な算出方法は、平均実行時間11631と実行回数11632の算出方法と同様であるが、平均実行時間11641と実行回数11642は、第1実行情報テーブル114の代わりに第2実行情報テーブル115に基づいて算出される。 After step 1604, the performance difference factor method determination unit 109 calculates the average execution time 11641 and the number of executions 11642 of the measurement target method in the second program 121 based on the second execution information table 115 (1605). The specific calculation method of the average execution time 11641 and the execution count 11642 is the same as the calculation method of the average execution time 11631 and the execution count 11632, but the average execution time 11641 and the execution count 11642 are the same as those in the first execution information table 114. Instead, it is calculated based on the second execution information table 115.
 ステップ1605の後、性能差要因メソッド判定部109は、実行時間差1165及び実行時間比1166を算出する(ステップ1606)。具体的には、性能差要因メソッド判定部109は、ステップ1605において算出された各組の実行時間の合計を実行回数11632によって除算した値から、ステップ1604において算出された各組の実行時間の合計を実行回数11642によって除算した値を減算することによって、実行時間差1165を算出する。 After step 1605, the performance difference factor method determination unit 109 calculates an execution time difference 1165 and an execution time ratio 1166 (step 1606). Specifically, the performance difference factor method determination unit 109 calculates the total execution time of each group calculated in step 1604 from the value obtained by dividing the total execution time of each group calculated in step 1605 by the execution count 11632. Is subtracted by the number of executions 11642 to calculate the execution time difference 1165.
 また、性能差要因メソッド判定部109は、ステップ1606において、算出された実行時間差1165を、さらに実行回数11632によって除算し、除算された結果を、さらに平均実行時間11631によって除算することによって、実行時間比1166を算出する。 In step 1606, the performance difference factor method determination unit 109 further divides the calculated execution time difference 1165 by the execution count 11632, and further divides the divided result by the average execution time 11631, thereby executing the execution time. The ratio 1166 is calculated.
 ステップ1606の後、性能差要因メソッド判定部109は、ステップ1604、ステップ1605、及び、ステップ1606において算出された平均実行時間11631、実行回数11632、平均実行時間11641、実行回数11642、実行時間差1165、及び、実行時間比1166を、測定結果テーブル116に格納する(1607)。 After step 1606, the performance difference factor method determination unit 109 calculates the average execution time 11631, the execution count 11632, the average execution time 11641, the execution count 11642, the execution time difference 1165, calculated in step 1604, step 1605, and step 1606. The execution time ratio 1166 is stored in the measurement result table 116 (1607).
 なお、ステップ1604からステップ1607の処理は、対象メソッドテーブル113に含まれる全てのメソッドに対して実施されてもよい。 Note that the processing from step 1604 to step 1607 may be performed for all methods included in the target method table 113.
 ステップ1607の後、性能差要因メソッド判定部109は、対象メソッドテーブル113の変数iが示す行のメソッド情報1132に対応する測定結果テーブル116のメソッド情報1162と、実行時間差1165と、実行時間比1166とを抽出する(1608)。 After step 1607, the performance difference factor method determination unit 109 executes the method information 1162 of the measurement result table 116 corresponding to the method information 1132 in the row indicated by the variable i of the target method table 113, the execution time difference 1165, and the execution time ratio 1166. Are extracted (1608).
 ステップ1608の後、性能差要因メソッド判定部109は、ステップ1608において抽出された実行時間比1166が、あらかじめユーザによって指定された実行時間比閾値以上であるか否かを判定する(1609)。実行時間比1166が実行時間比閾値以上でない場合、第1プログラム120と第2プログラム121とにおける測定対象メソッドの性能差は、ユーザにとって問題ない範囲であるため、性能差要因メソッド判定部109は、ステップ1613に移行する。 After step 1608, the performance difference factor method determination unit 109 determines whether or not the execution time ratio 1166 extracted in step 1608 is equal to or greater than the execution time ratio threshold specified in advance by the user (1609). If the execution time ratio 1166 is not equal to or greater than the execution time ratio threshold, the performance difference between the measurement target methods in the first program 120 and the second program 121 is in a range that is not problematic for the user. Control goes to step 1613.
 実行時間比1166が実行時間比閾値以上である場合、第1プログラム120と第2プログラム121とにおける測定対象メソッドの性能差は、ユーザにとって問題がある範囲であるため、性能差要因メソッド判定部109は、ステップ1610に移行する。 When the execution time ratio 1166 is equal to or greater than the execution time ratio threshold, the performance difference between the measurement target methods in the first program 120 and the second program 121 is in a range that causes a problem for the user. Shifts to step 1610.
 ステップ1609の後、性能差要因メソッド判定部109は、変数iが示す行の呼出元メソッド情報1133を対象メソッドテーブル113から抽出し、抽出された呼出元メソッド情報1133に対応するメソッド情報1162の実行時間差1165を、測定結果テーブル116から抽出する。そして、性能差要因メソッド判定部109は、抽出された実行時間差1165を、呼出元実行時間差に格納する(1610)。呼出元実行時間差とは、性能差要因メソッド判定部109によって保持される、メモリ102の中の一部の記憶領域である。 After step 1609, the performance difference factor method determination unit 109 extracts the caller method information 1133 of the row indicated by the variable i from the target method table 113, and executes the method information 1162 corresponding to the extracted caller method information 1133. The time difference 1165 is extracted from the measurement result table 116. Then, the performance difference factor method determination unit 109 stores the extracted execution time difference 1165 in the caller execution time difference (1610). The caller execution time difference is a partial storage area in the memory 102 held by the performance difference factor method determination unit 109.
 ステップ1610の後、性能差要因メソッド判定部109は、ステップ1608において抽出された実行時間差1165を、呼出元実行時間差によって除算する。そして、除算された結果を、性能差要因率に格納する(1611)。 After step 1610, the performance difference factor method determination unit 109 divides the execution time difference 1165 extracted in step 1608 by the caller execution time difference. The divided result is stored in the performance difference factor rate (1611).
 性能差要因率とは、性能差要因メソッド判定部109によって保持される、メモリ102の中の一部の記憶領域である。性能差要因率に格納される値が大きい程、呼出元メソッドの性能差から変化が大きいことを示す。すなわち、呼出元メソッドの性能差よりも、性能差が大きいメソッドは、第1プログラム120と第2プログラム121との性能差を生じさせるメソッドである可能性が高いため、性能差要因率が大きいほど、性能差を生じさせるメソッドである可能性が高い。 The performance difference factor rate is a partial storage area in the memory 102 held by the performance difference factor method determination unit 109. The larger the value stored in the performance difference factor rate, the greater the change from the performance difference of the caller method. That is, a method having a larger performance difference than that of the caller method is likely to be a method that causes a performance difference between the first program 120 and the second program 121. The method is likely to cause a performance difference.
 ステップ1611の後、性能差要因メソッド判定部109は、ステップ1611において算出された性能差要因率が示す値よりも、最大性能差要因率が示す値のほうが大きいか否かを判定する(1612)。 After step 1611, the performance difference factor method determination unit 109 determines whether or not the value indicated by the maximum performance difference factor rate is greater than the value indicated by the performance difference factor rate calculated in step 1611 (1612). .
 最大性能差要因率とは、性能差要因メソッド判定部109によって保持される、メモリ102の中の一部の記憶領域である。最大性能差要因率は、対象メソッドテーブル113の変数iが示す各行に、ステップ1608~ステップ1611を実行することによって算出される性能差要因率の中で、最も大きい値を示す性能差要因率の値を格納するための領域である。 The maximum performance difference factor rate is a partial storage area in the memory 102 held by the performance difference factor method determination unit 109. The maximum performance difference factor rate is the value of the performance difference factor rate showing the largest value among the performance difference factor rates calculated by executing Steps 1608 to 1611 in each row indicated by the variable i of the target method table 113. This is an area for storing values.
 ステップ1612において、ステップ1611において算出された性能差要因率が示す値より、最大性能差要因率が示す値は大きくない場合、最大性能差要因率が示す値は変更されないため、性能差要因メソッド判定部109は、ステップ1613に移行する。 In step 1612, if the value indicated by the maximum performance difference factor rate is not greater than the value indicated by the performance difference factor rate calculated in step 1611, the value indicated by the maximum performance difference factor rate is not changed. The unit 109 proceeds to step 1613.
 ステップ1612において、ステップ1611において算出された性能差要因率が示す値よりも、最大性能差要因率が示す値が大きい場合、性能差要因メソッド判定部109は、ステップ1611において算出された性能差要因率によって最大性能差要因率を更新する。また、変数iが示す対象メソッドテーブル113の行のメソッド情報1132の値によって、性能差要因メソッドを更新する(1613)。ステップ1612及びステップ1613の処理によって、性能差要因メソッドが抽出される。 In step 1612, when the value indicated by the maximum performance difference factor rate is greater than the value indicated by the performance difference factor rate calculated in step 1611, the performance difference factor method determination unit 109 determines that the performance difference factor calculated in step 1611 The maximum performance difference factor rate is updated according to the rate. Also, the performance difference factor method is updated with the value of the method information 1132 in the row of the target method table 113 indicated by the variable i (1613). Through the processing in step 1612 and step 1613, a performance difference factor method is extracted.
 ステップ1609、ステップ1612、又は、ステップ1613の後、性能差要因メソッド判定部109は、変数iに格納される値に、1を加算する。すなわち、ステップ1604~ステップ1613に示す処理を行う対象メソッドテーブル113の行を、一つ移動させる(1613)。 After step 1609, step 1612, or step 1613, the performance difference factor method determination unit 109 adds 1 to the value stored in the variable i. That is, one row of the target method table 113 for performing the processing shown in steps 1604 to 1613 is moved (1613).
 対象メソッドテーブル113のすべての行に、ステップ1604~ステップ1613の処理を行った後、性能差要因メソッド判定部109は、性能差要因メソッドの抽出処理が終了したことを制御部106に通知する(1614)。 After performing the processing of step 1604 to step 1613 for all the rows of the target method table 113, the performance difference factor method determination unit 109 notifies the control unit 106 that the extraction process of the performance difference factor method has ended ( 1614).
 なお、図13のステップ1609に示す処理において、実行時間比1166を算出することによって、第1のプログラムと第2のプログラムとの性能差を比較したが、実行時間差1165を比較することによって性能差を比較してもよい。すなわち、呼出元メソッドからの呼出回数が一定している場合などは、実行時間差1165によって性能差を比較してもよい。 In the processing shown in Step 1609 of FIG. 13, the performance difference between the first program and the second program is compared by calculating the execution time ratio 1166, but the performance difference is determined by comparing the execution time difference 1165. May be compared. That is, when the number of calls from the caller method is constant, the performance difference may be compared by the execution time difference 1165.
 図13のに示す処理、すなわち、図7に示すステップ160が終了した後、性能差要因メソッドに値が格納されている場合、図14に示す処理、すなわち、ステップ180が実行される。 After the process shown in FIG. 13, that is, step 160 shown in FIG. 7 is completed, if the value is stored in the performance difference factor method, the process shown in FIG. 14, that is, step 180 is executed.
 図14は、本発明の第1の実施形態の測定対象メソッドを再度設定する処理を示すフローチャートである。 FIG. 14 is a flowchart showing processing for setting the measurement target method again according to the first embodiment of this invention.
 図14に示す処理は、図7のステップ180に示す処理に相当する。 The process shown in FIG. 14 corresponds to the process shown in Step 180 of FIG.
 ステップ170の後、制御部106は、測定対象メソッドを再度設定する指示を、メソッド呼出照合部108に送信する(1801)。 After step 170, the control unit 106 transmits an instruction to set the measurement target method again to the method call matching unit 108 (1801).
 ステップ1801の後、メソッド呼出照合部108は、第1メソッド呼出テーブル111を読み込み(1802)、第2メソッド呼出テーブル112を読み込む(1803)。そして、対象メソッドテーブル113に格納された値を削除する(1804)。 After step 1801, the method call verification unit 108 reads the first method call table 111 (1802) and reads the second method call table 112 (1803). Then, the value stored in the target method table 113 is deleted (1804).
 ここで、第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112には、図12Bのステップ1525において格納されたメソッド情報1132が保持される。すなわち、次回の測定対象メソッドになる可能性があるメソッドを示す情報が保持される。 Here, the method information 1132 stored in step 1525 of FIG. 12B is held in the first method call table 111 and the second method call table 112. That is, information indicating a method that may become the next measurement target method is held.
 ステップ1804の後、メソッド呼出照合部108は、第1メソッド呼出テーブル111と第2メソッド呼出テーブル112とに共通して保持されるメソッド情報(1112及び1122)のうち、呼出元メソッド情報(1113及び1123)が示すメソッドが、図13に示す処理によって抽出された性能差要因メソッドであるメソッド情報(1112及び1122)を、対象メソッドテーブル113に格納する(1805)。 After step 1804, the method call verification unit 108 calls the source method information (1113 and 1122) out of the method information (1112 and 1122) held in common in the first method call table 111 and the second method call table 112. The method indicated by 1123) stores the method information (1112 and 1122) that is the performance difference factor method extracted by the processing shown in FIG. 13 in the target method table 113 (1805).
 ステップ1805の後、メソッド呼出照合部108は、測定対象メソッドの再設定の終了を制御部106に通知する(1806)。 After step 1805, the method call matching unit 108 notifies the control unit 106 of the end of resetting the measurement target method (1806).
 図14に示す処理の後、図7に示すステップ150からステップ180までの処理が、性能差要因メソッドが抽出されなくなるまで、繰り返される。 After the process shown in FIG. 14, the process from step 150 to step 180 shown in FIG. 7 is repeated until no performance difference factor method is extracted.
 第1の実施形態によれば、例えば、性能に影響のある修正が加えられたプログラムと、修正前のプログラムとの性能を比較することができる。また、修正前のプログラムの実行時間と修正後のプログラムの実行時間とに大きな差がない場合も、メソッドごとに実行時間を比較することによって、性能に著しい差が生じているメソッドを抽出できる。 According to the first embodiment, for example, it is possible to compare the performance of a program to which a modification that affects performance is added and a program before the modification. Further, even when there is no significant difference between the execution time of the program before correction and the execution time of the program after correction, it is possible to extract a method having a significant difference in performance by comparing the execution times for each method.
 また第1の実施形態によれば、例えば、アプリケーションサーバの分野においては、アプリケーションサーバのバージョンを固定すれば、2つのユーザアプリケーション間の性能差要因を分析でき、ユーザアプリケーションを固定すれば、アプリケーションサーバのバージョン間の性能差要因を分析できる。 According to the first embodiment, for example, in the field of application servers, if the version of the application server is fixed, the performance difference factor between the two user applications can be analyzed, and if the user application is fixed, the application server Can analyze the performance difference between different versions.
 さらに、第1の実施形態によれば、実行時間を測定するメソッドを抽出するため、実行時間の測定による負荷への影響が軽減され、性能に問題のある処理が含まれるメソッドを高い精度で検出することができる。 Furthermore, according to the first embodiment, since the method for measuring the execution time is extracted, the influence on the load due to the measurement of the execution time is reduced, and a method including a process having a problem in performance is detected with high accuracy. can do.
 図15は、本発明の第2の実施形態の単一のプログラムの性能差を分析する計算機100の構成を示すブロック図である。 FIG. 15 is a block diagram illustrating a configuration of the computer 100 that analyzes a performance difference of a single program according to the second embodiment of this invention.
 第2の実施形態の計算機100は、一つのプログラムのテストを実行し、一つのプログラムにおける性能を測定する。そして、ユーザによってあらかじめ指定された閾値と、測定された性能を比較し、性能差要因メソッドを抽出する。 The computer 100 of the second embodiment executes a test of one program and measures the performance of one program. Then, the threshold specified in advance by the user is compared with the measured performance, and a performance difference factor method is extracted.
 第2の実施形態の計算機100は、第1の実施形態の計算機100と同じ、メモリ102、演算装置101、外部記憶装置103、出力装置104、及び、入力装置105を備える。 The computer 100 of the second embodiment includes the same memory 102, arithmetic device 101, external storage device 103, output device 104, and input device 105 as the computer 100 of the first embodiment.
 また、第2の実施形態の制御部300、テスト実行部301、メソッド呼出照合部302、性能差要因メソッド判定部303、初期メソッド記録部308、対象メソッド記録部309、コールバック受信部310、JavaVM312、及び、JVMTI313は、第1の実施形態の制御部106、テスト実行部107、メソッド呼出照合部108、性能差要因メソッド判定部109、バージョン切替部110、初期メソッド記録部117、対象メソッド記録部118、コールバック受信部119、JavaVM122、及び、JVMTI123と各々同様な機能を持つ。また、第2の実施形態の対象メソッドテーブル305及び測定結果テーブル307は、第1の実施形態の対象メソッドテーブル113、測定結果テーブル116と同じ情報を含む。 In addition, the control unit 300, the test execution unit 301, the method call verification unit 302, the performance difference factor method determination unit 303, the initial method recording unit 308, the target method recording unit 309, the callback receiving unit 310, and the Java VM 312 according to the second embodiment. The JVMTI 313 includes a control unit 106, a test execution unit 107, a method call matching unit 108, a performance difference factor method determination unit 109, a version switching unit 110, an initial method recording unit 117, and a target method recording unit according to the first embodiment. 118, the callback receiver 119, the JavaVM 122, and the JVMTI 123 have the same functions. In addition, the target method table 305 and the measurement result table 307 of the second embodiment include the same information as the target method table 113 and the measurement result table 116 of the first embodiment.
 しかし、第2の実施形態の制御部300は、一つの測定対象プログラム311のみをテストするため、第1メソッド呼出テーブル111に対応するメソッド呼出テーブル304と、第1実行情報テーブル114に対応する実行情報テーブル306は、各々一つである。 However, since the control unit 300 according to the second embodiment tests only one measurement target program 311, a method call table 304 corresponding to the first method call table 111 and an execution corresponding to the first execution information table 114 are performed. There is one information table 306 for each.
 図16は、本発明の第2の実施形態のメソッド呼出テーブル304を示す説明図である。 FIG. 16 is an explanatory diagram illustrating a method call table 304 according to the second embodiment of this invention.
 メソッド呼出テーブル304は、第1の実施形態の第1メソッド呼出テーブル111及び第2メソッド呼出テーブル112と同じ情報を含み、フレーム番号3041、メソッド情報3042及び呼出元メソッド情報3043は、第1の実施形態のフレーム番号1111、メソッド情報1112及び呼出元メソッド情報1113に対応する。 The method call table 304 includes the same information as the first method call table 111 and the second method call table 112 of the first embodiment. The frame number 3041, the method information 3042, and the caller method information 3043 are the same as those in the first embodiment. This corresponds to the frame number 1111, method information 1112, and caller method information 1113 of the form.
 図17は、本発明の第2の実施形態の実行情報テーブル306を示す説明図である。 FIG. 17 is an explanatory diagram illustrating an execution information table 306 according to the second embodiment of this invention.
 実行情報テーブル306は、第1の実施形態の第1実行情報テーブル114及び第2実行情報テーブル115と同じ情報を含み、フレーム番号3061、メソッド情報3062、開始終了情報3063及び時刻3064は、第1の実施形態のフレーム番号1141、メソッド情報1142、開始終了情報1143及び時刻1144に対応する。 The execution information table 306 includes the same information as the first execution information table 114 and the second execution information table 115 of the first embodiment, and the frame number 3061, method information 3062, start / end information 3063, and time 3064 are the first information. Corresponds to the frame number 1141, method information 1142, start / end information 1143, and time 1144.
 図18は、本発明の第2の実施形態の測定結果テーブル307を示す説明図である。 FIG. 18 is an explanatory diagram illustrating a measurement result table 307 according to the second embodiment of this invention.
 測定結果テーブル307は、フレーム番号3071、メソッド情報3072、平均実行時間3073及び実行回数3074を含む。フレーム番号3071、メソッド情報3072、平均実行時間3073及び実行回数3074は、第1の実施形態の測定結果テーブル116のフレーム番号1161、メソッド情報1162、平均実行時間11631及び実行回数11632に対応する。 The measurement result table 307 includes a frame number 3071, method information 3072, an average execution time 3073, and an execution count 3074. The frame number 3071, the method information 3072, the average execution time 3073, and the execution count 3074 correspond to the frame number 1161, the method information 1162, the average execution time 11631, and the execution count 11632 in the measurement result table 116 of the first embodiment.
 以下に、第1の実施形態の処理と異なる処理について説明する。 Hereinafter, processing different from the processing of the first embodiment will be described.
 図19は、本発明の第2の実施形態の全体の処理を示すフローチャートである。 FIG. 19 is a flowchart showing the overall processing of the second embodiment of the present invention.
 制御部300は、まず、測定対象プログラム311の初期メソッドを抽出し、抽出された初期メソッドを対象メソッドテーブル305に格納する。これによって、測定対象メソッドが対象メソッドテーブル305に格納される(320)。 The control unit 300 first extracts the initial method of the measurement target program 311 and stores the extracted initial method in the target method table 305. As a result, the measurement target method is stored in the target method table 305 (320).
 制御部300は、ステップ320において、図10A~図10Cに示す処理を、測定対象プログラム311のみに実行する。具体的には、制御部300は、図10Aに示すステップ1402からステップ1409までをテスト実行部301に実行させることによって、測定対象プログラム311のテストを実行する。図10Aに示す処理が実行される際、制御部300は、コールバック受信部310及び初期メソッド記録部308によって、図10Cに示す処理を測定対象プログラム311のみに実行する。 In step 320, the control unit 300 executes the processing shown in FIGS. 10A to 10C only for the measurement target program 311. Specifically, the control unit 300 executes the test of the measurement target program 311 by causing the test execution unit 301 to execute steps 1402 to 1409 shown in FIG. 10A. When the process illustrated in FIG. 10A is executed, the control unit 300 causes the callback receiver 310 and the initial method recording unit 308 to execute the process illustrated in FIG.
 さらにステップ320において制御部300は、メソッド呼出照合部302によって、図10Bに示すステップ1421、ステップ1423及びステップ1424を測定対象プログラム311に実行する。ここで、ステップ1424において、メソッド呼出照合部302は、メソッド呼出テーブルに含まれるメソッド情報3042を、すべて対象メソッドテーブル305に格納する。 Further, in step 320, the control unit 300 causes the method call matching unit 302 to execute steps 1421, 1423, and 1424 shown in FIG. Here, in step 1424, the method call matching unit 302 stores all the method information 3042 included in the method call table in the target method table 305.
 ステップ320の後、制御部300は、測定対象メソッドの実行時間を測定する(330)。制御部300は、ステップ330において、図12A及び図12Bに示す処理を測定対象プログラム311にのみ実行する。 After step 320, the control unit 300 measures the execution time of the measurement target method (330). In step 330, the control unit 300 executes the process shown in FIGS. 12A and 12B only for the measurement target program 311.
 具体的には、制御部300は、ステップ330において、ステップ1502からステップ1507までをテスト実行部301に実行させることによって、測定対象プログラム311のテストを実行する。そして、測定対象プログラム311をテストしている間に、対象メソッド記録部309によって、図12Bに示す処理を測定対象プログラム311に実行する。 Specifically, the control unit 300 executes the test of the measurement target program 311 by causing the test execution unit 301 to execute steps 1502 to 1507 in step 330. Then, while the measurement target program 311 is being tested, the target method recording unit 309 executes the process shown in FIG.
 ステップ330の後、制御部300は、所定の条件を満たすメソッドを抽出する。 After step 330, the control unit 300 extracts a method that satisfies a predetermined condition.
 図20は、本発明の第2の実施形態の所定の条件を満たすメソッドを抽出する処理を示すフローチャートである。 FIG. 20 is a flowchart showing a process of extracting a method that satisfies a predetermined condition according to the second embodiment of the present invention.
 図20に示す処理は、図19に示すステップ340に相当する。 The process shown in FIG. 20 corresponds to step 340 shown in FIG.
 制御部300は、所定の条件を満たすメソッドを抽出する指示を性能差要因メソッド判定部303に送信する(3401)。 The control unit 300 transmits an instruction to extract a method satisfying a predetermined condition to the performance difference factor method determination unit 303 (3401).
 ステップ3401の後、性能差要因メソッド判定部303は、変数iをメモリ102に保持し、変数iに1を格納する(3402)。変数iは、対象メソッドテーブル305の行を示すポインタである。 After step 3401, the performance difference factor method determination unit 303 holds the variable i in the memory 102 and stores 1 in the variable i (3402). A variable i is a pointer indicating a row of the target method table 305.
 ステップ3402の後、性能差要因メソッド判定部303は、ステップ3403からステップ3408までの処理を、変数iに格納された値が対象メソッドテーブル305の行数を超えるまで、繰り返す(3402)。 After step 3402, the performance difference factor method determination unit 303 repeats the processing from step 3403 to step 3408 until the value stored in the variable i exceeds the number of rows in the target method table 305 (3402).
 ステップ1602の後、性能差要因メソッド判定部303は、測定対象メソッドの平均実行時間3073と実行回数3074とを実行情報テーブル306に基づいて、算出する(3403)。平均実行時間3073と実行回数3074との算出方法は、第1の実施形態の平均実行時間11631及び実行回数11632の算出方法と同じである。 After step 1602, the performance difference factor method determination unit 303 calculates the average execution time 3073 and the number of executions 3074 of the measurement target method based on the execution information table 306 (3403). The calculation method of the average execution time 3073 and the execution count 3074 is the same as the calculation method of the average execution time 11631 and the execution count 11632 of the first embodiment.
 ステップ3403の後、性能差要因メソッド判定部303は、算出された平均実行時間3073と実行回数3074とを、測定結果テーブル307に格納する(3404)。 After step 3403, the performance difference factor method determination unit 303 stores the calculated average execution time 3073 and execution count 3074 in the measurement result table 307 (3404).
 ステップ3404の後、性能差要因メソッド判定部303は、平均実行時間3073及び実行回数3074を乗じた値が、ユーザによってあらかじめ指定された閾値よりも大きいか否かを判定する(3405)。平均実行時間3073及び実行回数3074を乗じた値が、ユーザによってあらかじめ指定された閾値を超えない場合、変数iが示すメソッドには問題がないため、性能差要因メソッド判定部303は、ステップ3408に移行する。 After step 3404, the performance difference factor method determination unit 303 determines whether or not a value obtained by multiplying the average execution time 3073 and the number of executions 3074 is larger than a threshold value specified in advance by the user (3405). If the value obtained by multiplying the average execution time 3073 and the number of executions 3074 does not exceed the threshold value designated in advance by the user, there is no problem with the method indicated by the variable i. Transition.
 ステップ3405において、平均実行時間3073及び実行回数3074を乗じた値が、ユーザによってあらかじめ指定された閾値よりも大きいと判定された場合、変数iが示すメソッドに問題がある可能性があるため、性能差要因メソッド判定部303は、ステップ3406に移行する。 If it is determined in step 3405 that the value obtained by multiplying the average execution time 3073 and the number of executions 3074 is larger than the threshold value specified in advance by the user, there is a possibility that there is a problem in the method indicated by the variable i. The difference factor method determination unit 303 proceeds to step 3406.
 ステップ3405の後、性能差要因メソッド判定部303は、平均実行時間3073及び実行回数3074を乗じた値が、最大実行時間メソッドの平均実行時間3073及び実行回数3074を乗じた値よりも大きいか否かを判定する(3407)。最大実行時間メソッドは、性能差要因メソッド判定部303によってメモリ102に保持される記憶領域であり、所定の条件を満たすメソッドのうち、平均実行時間3073及び実行回数3074を乗じた値が最も大きいメソッドを示す情報を格納するための領域である。 After step 3405, the performance difference factor method determination unit 303 determines whether the value obtained by multiplying the average execution time 3073 and the execution count 3074 is greater than the value obtained by multiplying the average execution time 3073 and the execution count 3074 of the maximum execution time method. It is determined (3407). The maximum execution time method is a storage area held in the memory 102 by the performance difference factor method determination unit 303, and among the methods satisfying a predetermined condition, the method having the largest value obtained by multiplying the average execution time 3073 and the execution count 3074 This is an area for storing information indicating.
 平均実行時間3073及び実行回数3074を乗じた値が、最大実行時間メソッドの平均実行時間3073及び実行回数3074を乗じた値を超えない場合、性能差要因メソッド判定部303は、ステップ3409に移行する。 If the value obtained by multiplying the average execution time 3073 and the number of executions 3074 does not exceed the value obtained by multiplying the average execution time 3073 and the number of executions 3074 of the maximum execution time method, the performance difference factor method determination unit 303 proceeds to Step 3409. .
 平均実行時間3073及び実行回数3074を乗じた値が、最大実行時間メソッドの平均実行時間3073及び実行回数3074を乗じた値よりも大きい場合、変数iが示すメソッドによって、最大実行時間メソッドを更新する(3408)。 When the value obtained by multiplying the average execution time 3073 and the execution count 3074 is larger than the value obtained by multiplying the average execution time 3073 and the execution count 3074 of the maximum execution time method, the maximum execution time method is updated by the method indicated by the variable i. (3408).
 ステップ3406、ステップ3407、又は、ステップ3408の後、性能差要因メソッド判定部303は、変数iに格納される値に、1を加算する(3409)。これによって、性能差要因メソッド判定部303は、対象メソッドテーブル305の次の行を取得することができる。 After step 3406, step 3407, or step 3408, the performance difference factor method determination unit 303 adds 1 to the value stored in the variable i (3409). As a result, the performance difference factor method determination unit 303 can acquire the next row of the target method table 305.
 ステップ3403の繰り返し処理が終了した後、性能差要因メソッド判定部303は、所定の条件を満たすメソッドを抽出する処理の終了を、制御部300に通知する(3410)。 After the repetition process of step 3403 is completed, the performance difference factor method determination unit 303 notifies the control unit 300 of the end of the process of extracting a method that satisfies a predetermined condition (3410).
 なお、前述の第2の実施形態において、図10A~図10C、図12A、図12B及び図14に示す処理のうち、第1メソッド呼出テーブル111及び第1実行情報テーブル114は、メソッド呼出テーブル304及び対象メソッド記録部309に置き換える。 In the second embodiment described above, of the processes shown in FIGS. 10A to 10C, 12A, 12B, and 14, the first method call table 111 and the first execution information table 114 are the method call table 304. And the target method recording unit 309.
 また、本実施形態の計算機100は、第1の実施形態と第2の実施形態との両方を実行することが可能である。すなわち、ユーザが、一つのプログラムの性能を測定するか、又は、二つのプログラムの性能を比較するかをあらかじめ指定し、制御部106又は制御部300が、ユーザからの指定をに基づいて、第1の実施形態を実行するか、又は、第2の実施形態を実行するかを選択してよい。 In addition, the computer 100 according to the present embodiment can execute both the first embodiment and the second embodiment. That is, the user designates in advance whether to measure the performance of one program or to compare the performance of two programs, and the control unit 106 or the control unit 300 determines whether the first program is based on the designation from the user. You may choose to perform one embodiment or a second embodiment.
 また、前述の第1の実施形態及び第2の実施形態における初期メソッドは、プログラムを実行することによって自動的に抽出されたが、ユーザによって指定されてもよい。 In addition, although the initial method in the first embodiment and the second embodiment described above is automatically extracted by executing the program, it may be specified by the user.
 図21は、本発明の第2の実施形態の初期メソッドを指定するための画面を示す説明図である。 FIG. 21 is an explanatory diagram showing a screen for designating an initial method according to the second embodiment of this invention.
 図21に示す画面400は、第2の実施形態の初期メソッドを指定するための画面であるが、第1の実施形態において用いられてもよい。 A screen 400 shown in FIG. 21 is a screen for designating an initial method of the second embodiment, but may be used in the first embodiment.
 画面400は、制御部300(又は制御部106)が出力装置104を介してユーザに表示する画面である。画面400は、選択領域401、選択領域402、指示領域403を含む。ユーザは、出力装置104に表示された画面400を、入力装置105によって操作することによって、画面400に示された情報を指定する。 The screen 400 is a screen that the control unit 300 (or the control unit 106) displays to the user via the output device 104. The screen 400 includes a selection area 401, a selection area 402, and an instruction area 403. The user designates information shown on the screen 400 by operating the screen 400 displayed on the output device 104 with the input device 105.
 選択領域401は、初期メソッドを抽出する方法を選択するためのボタン等を含む。図21に示す選択領域401において、"自動"ボタンが選択された場合、制御部300(又は制御部106)は、ステップ320によって、初期メソッドを自動的に抽出する。"手動"ボタンが選択された場合、制御部300(又は制御部106は、ステップ320(又は140)を実行せず、ユーザによって指定された初期メソッドを対象メソッドテーブル305(又は対象メソッドテーブル113)に格納する。 The selection area 401 includes a button for selecting a method for extracting an initial method. When the “automatic” button is selected in the selection area 401 shown in FIG. 21, the control unit 300 (or the control unit 106) automatically extracts the initial method in step 320. When the “manual” button is selected, the control unit 300 (or the control unit 106 does not execute step 320 (or 140), and the initial method specified by the user is selected as the target method table 305 (or the target method table 113). To store.
 選択領域402は、選択領域401において"手動"が選択された場合において、初期メソッドを指定するためのチェックボックス等を含む。図21に示す選択領域402には、プログラムによって呼ばれるメソッドが階層構造によって表示される。選択領域402に表示される各メソッドは、チェックボックスによって選択可能である。 The selection area 402 includes a check box for designating an initial method when “manual” is selected in the selection area 401. In the selection area 402 shown in FIG. 21, methods called by programs are displayed in a hierarchical structure. Each method displayed in the selection area 402 can be selected by a check box.
 ユーザは、選択領域401及び選択領域402において、初期メソッドを抽出するための情報を指定すると、指示領域403に含まれるボタン等を操作する。その後、制御部300(又は制御部106)は、画面400によって指定された情報に基づいて、図19(又は図7)に示す処理を開始する。 When the user designates information for extracting an initial method in the selection area 401 and the selection area 402, the user operates a button or the like included in the instruction area 403. Thereafter, the control unit 300 (or the control unit 106) starts the process shown in FIG. 19 (or FIG. 7) based on the information specified on the screen 400.
 第2の実施形態によれば、一つのプログラムにおいて、性能に影響があるメソッド(最大実行時間メソッド)を自動的に抽出することができる。また、第1の実施形態と同じく、実行時間を測定するメソッドを抽出するため、プログラムの規模によらず、精度よく最大実行時間メソッドを抽出することができる。 According to the second embodiment, a method (maximum execution time method) that affects performance can be automatically extracted in one program. Further, since the method for measuring the execution time is extracted as in the first embodiment, the maximum execution time method can be accurately extracted regardless of the scale of the program.
 さらに、本実施形態は、ユーザによって初期メソッドを指定することが可能であるため、実行時間を測定したいプログラムの一部を、限定的に測定することが可能である。例えば、プログラムの一部が修正され、すべてのプログラムの性能を測定する必要がない場合、ユーザは、性能を測定したいプログラムの一部を最初に実行するメソッドを、初期メソッドに指定する。これによって、短時間で性能を測定することが可能であり、消費電力を低減できる。 Furthermore, in this embodiment, since an initial method can be designated by the user, a part of a program whose execution time is desired to be measured can be measured in a limited manner. For example, when a part of a program is modified and it is not necessary to measure the performance of all programs, the user designates a method that first executes a part of the program whose performance is to be measured as an initial method. As a result, performance can be measured in a short time, and power consumption can be reduced.
 なお、本発明は、前記所定の条件に、呼び出し元メソッドの実行時間及び実行回数を判定条件に用いることもできるため、例えば、呼び出し元メソッドの実行時間に対する割合と所定の閾値とを比較することによって、性能差要因メソッド又は最大実行時間メソッドを抽出してもよい。 In the present invention, since the execution time and the number of executions of the caller method can be used as the determination condition for the predetermined condition, for example, a ratio with respect to the execution time of the caller method is compared with a predetermined threshold. The performance difference factor method or the maximum execution time method may be extracted.
 以上、本発明の実施に関わる性能分析装置、方法、及びプログラムについて説明したが、本発明はこのような具体的構成に限定されるものではなく、添付した請求の範囲の趣旨内における様々な変更及び同等の構成を含むものである。 The performance analysis apparatus, method, and program related to the implementation of the present invention have been described above, but the present invention is not limited to such a specific configuration, and various modifications within the scope of the appended claims. And equivalent configurations.
 本発明は、アプリケーションサーバにおいてプログラムの性能を測定するシステムに適用可能である。 The present invention is applicable to a system that measures the performance of a program in an application server.

Claims (18)

  1.  計算機によってプログラムの性能を測定する性能測定方法であって、
     前記計算機は、プロセッサと、前記プロセッサによって実行されるプログラムを格納するメモリとを有し、
     前記方法は、
     前記計算機が、前記性能が測定されるプログラムによって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを最初に決定する手順と、
     前記計算機が、前記プログラムを実行することによって、前記決定された各第1のメソッドの実行時間を測定する手順と、
     前記計算機が、前記測定された各第1のメソッドの実行時間を用いて、所定の条件に一致する少なくとも一つの第2のメソッドが前記各第1のメソッドから抽出可能か否かを判定する手順と、
     前記少なくとも一つの第2のメソッドが抽出可能である場合、前記計算機が、前記抽出された各第2のメソッドから直接呼ばれる少なくとも一つの第3のメソッドが抽出可能か否かを判定する手順と、
     前記少なくとも一つの第3のメソッドが抽出可能である場合、前記計算機が、前記抽出された第3のメソッドを、第1のメソッドに決定する手順と、
     前記計算機が、前記実行時間を測定する手順と、前記第2のメソッドが抽出可能か否かを判定する手順と、前記第3のメソッドが抽出可能か否かを判定する手順と、前記第3のメソッドを第1のメソッドに決定する手順とを繰り返し実行する手順とを含むことを特徴とする性能測定方法。
    A performance measurement method for measuring the performance of a program by a computer,
    The computer includes a processor and a memory that stores a program executed by the processor.
    The method
    A step in which the computer first determines at least one first method among methods called directly by the program whose performance is measured;
    A step in which the computer measures the execution time of each determined first method by executing the program;
    The computer determines whether or not at least one second method that matches a predetermined condition can be extracted from each first method by using the measured execution time of each first method. When,
    If the at least one second method is extractable, the computer determines whether at least one third method called directly from each extracted second method can be extracted;
    If the at least one third method is extractable, the computer determines the extracted third method as the first method;
    A procedure for the computer to measure the execution time; a procedure for determining whether the second method can be extracted; a procedure for determining whether the third method can be extracted; And a step of repeatedly executing a step of determining the method as the first method.
  2.  請求項1に記載の性能測定方法であって、
     前記性能が測定されるプログラムは、第1のプログラム及び第2のプログラムを含み、
     前記少なくとも一つの第1のメソッドを最初に決定する手順は、前記計算機が、前記第1のプログラム及び第2のプログラムの両方によって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを決定する手順を含み、
     前記実行時間を測定する手順は、前記計算機が、前記各第1のメソッドの前記第1のプログラムにおける第1の実行時間と、前記各第1のメソッドの前記第2のプログラムにおける第2の実行時間とを測定する手順を含み、
     前記第2のメソッドが抽出可能か否かを判定する手順は、前記計算機が、前記測定された各第1の実行時間と各第2の実行時間とを用いて、前記所定の条件に一致する第2のメソッドが前記第1のメソッドから抽出可能か否かを判定する手順を含むことを特徴とする性能測定方法。
    The performance measurement method according to claim 1,
    The program whose performance is measured includes a first program and a second program,
    The procedure of first determining the at least one first method is a procedure in which the computer determines at least one first method among methods directly called by both the first program and the second program. Including
    The procedure for measuring the execution time is such that the computer executes a first execution time in the first program of each first method and a second execution in the second program of each first method. Including procedures for measuring time and
    The procedure for determining whether or not the second method can be extracted matches the predetermined condition using the measured first execution time and the second execution time. A performance measurement method comprising a step of determining whether or not a second method can be extracted from the first method.
  3.  請求項2に記載の性能測定方法であって、
     前記少なくとも一つの第1のメソッドを最初に決定する手順は、
     前記計算機が、前記第1のプログラムの開始後に開始し、前記第1のプログラムの終了前に終了するメソッドのうち、呼び出し元が前記第1のプログラムの開始前に開始されたか、または前記第1のプログラムの終了後に終了されたメソッドである、少なくとも一つの第4のメソッドを抽出する手順と、
     前記計算機が、前記第2のプログラムの開始後に開始し、前記第2のプログラムの終了前に終了するメソッドのうち、呼び出し元が前記第2のプログラムの開始前に開始されたか、または前記第2のプログラムの終了後に終了されたメソッドである、少なくとも一つの第5のメソッドを抽出する手順と、
     前記計算機が、前記第4のメソッドと前記第5のメソッドとのうち、同じメソッドを各第1のメソッドとして決定する手順とを含むことを特徴とする性能測定方法。
    The performance measurement method according to claim 2,
    The procedure for initially determining the at least one first method comprises:
    Of the methods that the computer starts after the start of the first program and ends before the end of the first program, the caller has started before the start of the first program, or the first A procedure for extracting at least one fourth method, which is a method terminated after completion of the program;
    Among the methods that the computer starts after the start of the second program and ends before the end of the second program, the caller is started before the start of the second program, or the second A procedure for extracting at least one fifth method, which is a method terminated after completion of the program;
    The performance measurement method characterized by including the procedure in which the said computer determines the same method as each 1st method among the said 4th method and the said 5th method.
  4.  請求項2又は3に記載の性能測定方法であって、
     前記少なくとも一つの第2のメソッドが抽出可能か否かを判定する手順は、
     前記計算機が、前記第1のメソッドを直接呼んだ第6のメソッドが、前記第1のプログラムにおいて実行された第1の実行回数と、前記第1のメソッドを直接呼んだ前記各第6のメソッドが前記第2のプログラムにおいて実行された第2の実行回数とを保持する手順と、
     前記計算機が、前記第6のメソッドから呼ばれる第1のメソッドの、前記第1のプログラムにおける第1の合計実行時間と、前記第2のプログラムにおける第2の合計実行時間とを保持する手順と、
     前記計算機が、前記第2の合計実行時間を前記第2の実行回数によって除算した結果から、前記第1の合計実行時間を前記第1の実行回数によって除算した結果を、減算することによって、実行時間差を算出する手順と、
     前記計算機が、前記算出された実行時間差が、所定の条件に一致する前記第1のメソッドが第2のメソッドとして抽出可能か否かを判定する手順とを、含むことを特徴とする性能測定方法。
    The performance measurement method according to claim 2 or 3,
    The procedure for determining whether or not the at least one second method can be extracted includes:
    The sixth method in which the computer directly calls the first method is the first number of executions executed in the first program, and each sixth method in which the first method is directly called. Holding a second execution count executed in the second program,
    A procedure in which the computer holds a first total execution time in the first program and a second total execution time in the second program of the first method called from the sixth method;
    Execution by subtracting the result of dividing the first total execution time by the first number of executions from the result of dividing the second total execution time by the second number of executions. The procedure for calculating the time difference;
    And a step of determining whether or not the computer can extract the first method whose calculated execution time difference matches a predetermined condition as a second method. .
  5.  請求項4に記載の性能測定方法であって、
     前記実行時間差によって第2のメソッドが抽出可能か否かを判定する手順は、
     前記計算機が、前記第1のメソッドが、前記第1のプログラムにおいて実行された第3の実行回数と、1回あたりの第1の平均実行時間とを保持する手順と、
     前記計算機が、前記算出された実行時間差を、前記第3の実行回数と、前記第1の平均実行時間とによって除算することによって、実行時間比を算出する手順と、
     前記計算機が、前記算出された実行時間比と、所定の閾値とを比較する手順と、
     前記比較の結果、前記計算機が、前記算出された実行時間比が、所定の閾値より大きい前記第1のメソッドが第2のメソッドとして抽出可能か否かを判定する手順とを、含むことを特徴とする性能測定方法。
    The performance measurement method according to claim 4,
    The procedure for determining whether the second method can be extracted based on the execution time difference is as follows:
    A step in which the computer holds the third execution number of times that the first method is executed in the first program and a first average execution time per time;
    A step of calculating an execution time ratio by dividing the calculated execution time difference by the third execution count and the first average execution time;
    A step in which the computer compares the calculated execution time ratio with a predetermined threshold;
    As a result of the comparison, the computer includes a procedure for determining whether or not the first method having the calculated execution time ratio larger than a predetermined threshold can be extracted as a second method. A performance measurement method.
  6.  請求項1から5のいずれか一つに記載の性能測定方法であって、
     前記計算機は、ユーザが少なくとも一つのメソッドを指定するための入力装置を備え、
     前記少なくとも一つの第1のメソッドを最初に決定する手順は、前記入力装置を介して、前記ユーザから各メソッドが指定された場合、前記計算機が、前記指定されたメソッドを、前記各第1のメソッドに決定する手順を含むことを特徴とする性能測定方法。
    A performance measurement method according to any one of claims 1 to 5,
    The computer includes an input device for a user to specify at least one method,
    The procedure for first determining the at least one first method is as follows. When each method is designated by the user via the input device, the computer designates the designated method as the first method. A method for measuring performance, comprising a procedure for determining a method.
  7.  請求項1から6のいずれか一つに記載の性能測定方法であって、
     前記各第1のメソッドの実行時間を測定する手順は、
     前記計算機が、前記各第1のメソッドが開始した時刻と、前記各第1のメソッドが終了した時刻とを取得する手順と、
     前記計算機が、前記取得された各第1のメソッドが終了した時刻から、前記取得された各第1のメソッドが開始した時刻を減算することによって、前記各実行時間を算出する手順とを含むことを特徴とする性能測定方法。
    A performance measurement method according to any one of claims 1 to 6,
    The procedure for measuring the execution time of each first method is as follows:
    A procedure for the computer to obtain a time at which each first method starts and a time at which each first method ends;
    And a step of calculating each execution time by subtracting a time at which each acquired first method starts from a time at which each acquired first method ends. A method for measuring performance.
  8.  プログラムの性能を測定する性能測定装置であって、
     前記性能測定装置は、
     プロセッサと、前記プロセッサによって実行されるプログラムを格納するメモリとを有し、
     前記性能が測定されるプログラムによって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを最初に決定し、
     前記プログラムを実行することによって、前記決定された各第1のメソッドの実行時間を測定し、
     前記測定された各第1のメソッドの実行時間を用いて、所定の条件に一致する少なくとも一つの第2のメソッドが前記各第1のメソッドから抽出可能か否かを判定し、
     前記少なくとも一つの第2のメソッドが抽出可能である場合、前記抽出された各第2のメソッドから直接呼ばれる少なくとも一つの第3のメソッドが抽出可能か否かを判定し、
     前記少なくとも一つの第3のメソッドが抽出可能である場合、前記抽出された第3のメソッドを、第1のメソッドに決定し、
     前記実行時間を測定し、前記第2のメソッドが抽出可能か否かを判定し、前記第3のメソッドが抽出可能か否かを判定し、前記第3のメソッドを第1のメソッドに決定する手順を繰り返し実行することを特徴とする性能測定装置。
    A performance measuring device for measuring the performance of a program,
    The performance measuring device is
    A processor and a memory for storing a program executed by the processor;
    First determining at least one first method among methods called directly by the program whose performance is to be measured;
    Measuring the execution time of each determined first method by executing the program;
    Using the measured execution time of each first method to determine whether at least one second method matching a predetermined condition can be extracted from each first method;
    If the at least one second method is extractable, determine whether at least one third method called directly from each extracted second method is extractable;
    If the at least one third method is extractable, the extracted third method is determined as a first method;
    Measure the execution time, determine whether the second method can be extracted, determine whether the third method can be extracted, and determine the third method as the first method A performance measuring apparatus characterized by repeatedly executing a procedure.
  9.  請求項8に記載の性能測定装置であって、
     前記性能が測定されるプログラムは、第1のプログラム及び第2のプログラムを含み、
     前記性能測定装置は、
     前記第1のプログラム及び第2のプログラムの両方によって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを決定し、
     前記各第1のメソッドの前記第1のプログラムにおける第1の実行時間と、前記各第1のメソッドの前記第2のプログラムにおける第2の実行時間とを測定し、
     前記測定された各第1の実行時間と各第2の実行時間とを用いて、前記所定の条件に一致する第2のメソッドが前記第1のメソッドから抽出可能か否かを判定することを特徴とする性能測定装置。
    The performance measuring device according to claim 8,
    The program whose performance is measured includes a first program and a second program,
    The performance measuring device is
    Determining at least one first method among methods called directly by both the first program and the second program;
    Measuring a first execution time in the first program of each first method and a second execution time in the second program of each first method;
    Determining whether a second method that matches the predetermined condition can be extracted from the first method by using the measured first execution time and the second execution time; A characteristic performance measuring device.
  10.  請求項9に記載の性能測定装置であって、
     前記性能測定装置は、
     前記第1のプログラムの開始後に開始し、前記第1のプログラムの終了前に終了するメソッドのうち、呼び出し元が前記第1のプログラムの開始前に開始されたか、または前記第1のプログラムの終了後に終了されたメソッドである、少なくとも一つの第4のメソッドを抽出し、
     前記第2のプログラムの開始後に開始し、前記第2のプログラムの終了前に終了するメソッドのうち、呼び出し元が前記第2のプログラムの開始前に開始されたか、または前記第2のプログラムの終了後に終了されたメソッドである、少なくとも一つの第5のメソッドを抽出し、
     前記第4のメソッドと前記第5のメソッドとのうち、同じメソッドを各第1のメソッドとして最初に決定する手順とを含むことを特徴とする性能測定装置。
    The performance measuring device according to claim 9,
    The performance measuring device is
    Of the methods that start after the first program starts and end before the first program ends, the caller started before the first program starts or the first program ends Extract at least one fourth method that is later terminated,
    Of the methods that start after the start of the second program and end before the end of the second program, the caller started before the start of the second program, or the end of the second program Extract at least one fifth method, which is a method that was terminated later,
    A performance measuring apparatus comprising: a step of first determining the same method as each first method out of the fourth method and the fifth method.
  11.  請求項9又は10に記載の性能測定装置であって、
     前記性能測定装置は、
     前記第1のメソッドを直接呼んだ第6のメソッドが、前記第1のプログラムにおいて実行された第1の実行回数と、前記第1のメソッドを直接呼んだ前記各第6のメソッドが前記第2のプログラムにおいて実行された第2の実行回数とを保持し、
     前記第6のメソッドから呼ばれる第1のメソッドの、前記第1のプログラムにおける第1の合計実行時間と、前記第2のプログラムにおける第2の合計実行時間とを保持し、
     前記第2の合計実行時間を前記第2の実行回数によって除算した結果から、前記第1の合計実行時間を前記第1の実行回数によって除算した結果を、減算することによって、実行時間差を算出し、
     前記算出された実行時間差が、所定の条件に一致する前記第1のメソッドが第2のメソッドとして抽出可能か否かを判定することを特徴とする性能測定装置。
    The performance measuring device according to claim 9 or 10,
    The performance measuring device is
    The sixth method that directly calls the first method is the first number of executions executed in the first program, and each sixth method that directly calls the first method is the second method. And the second execution count executed in the program of
    Holding a first total execution time in the first program and a second total execution time in the second program of the first method called from the sixth method;
    An execution time difference is calculated by subtracting a result of dividing the first total execution time by the first number of executions from a result of dividing the second total execution time by the second number of executions. ,
    A performance measurement apparatus that determines whether or not the calculated first execution method whose execution time difference matches a predetermined condition can be extracted as a second method.
  12.  請求項11に記載の性能測定装置であって、
     前記性能測定装置は、
     前記第1のメソッドが、前記第1のプログラムにおいて実行された第3の実行回数と、1回あたりの第1の平均実行時間とを保持し、
     前記算出された実行時間差を、前記第3の実行回数と、前記第1の平均実行時間とによって除算することによって、実行時間比を算出し、
     前記算出された実行時間比と、所定の閾値とを比較し、
     前記比較の結果、前記算出された実行時間比が、所定の閾値より大きい前記第1のメソッドが第2のメソッドとして抽出可能か否かを判定することを特徴とする性能測定装置。
    The performance measuring device according to claim 11,
    The performance measuring device is
    The first method holds a third execution number of times executed in the first program and a first average execution time per time,
    An execution time ratio is calculated by dividing the calculated execution time difference by the third execution count and the first average execution time,
    Comparing the calculated execution time ratio with a predetermined threshold;
    As a result of the comparison, it is determined whether or not the first method having the calculated execution time ratio larger than a predetermined threshold can be extracted as a second method.
  13.  請求項8から12のいずれか一つに記載の性能測定装置であって、
     前記性能測定装置は、
     ユーザが少なくとも一つのメソッドを指定するための入力装置を備え、
     前記入力装置を介して、前記ユーザから各メソッドが指定された場合、前記指定されたメソッドを、前記各第1のメソッドに決定することを特徴とする性能測定装置。
    The performance measuring device according to any one of claims 8 to 12,
    The performance measuring device is
    An input device for the user to specify at least one method;
    When each method is designated by the user via the input device, the designated method is determined as the first method.
  14.  請求項8から13のいずれか一つに記載の性能測定装置であって、
     前記性能測定装置は、
     前記前記各第1のメソッドが開始した時刻と、前記各第1のメソッドが終了した時刻とを取得し、
     前記取得された各第1のメソッドが終了した時刻から、前記取得された各第1のメソッドが開始した時刻を減算することによって、前記各実行時間を算出することを特徴とする性能測定装置。
    The performance measuring device according to any one of claims 8 to 13,
    The performance measuring device is
    Obtaining a time at which each of the first methods starts and a time at which each of the first methods ends;
    The performance measuring apparatus according to claim 1, wherein the execution time is calculated by subtracting a time at which each acquired first method starts from a time at which each acquired first method ends.
  15.  計算機にプログラムの性能を測定させる性能測定プログラムであって、
     前記計算機は、プロセッサと、前記プロセッサによって実行されるプログラムを格納するメモリとを有し、
     前記性能測定プログラムは、
     前記計算機に、前記性能が測定されるプログラムによって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを最初に決定させる手順と、
     前記計算機に、前記プログラムを実行することによって、前記決定された各第1のメソッドの実行時間を測定させる手順と、
     前記計算機に、前記測定された各第1のメソッドの実行時間を用いて、所定の条件に一致する少なくとも一つの第2のメソッドが前記各第1のメソッドから抽出可能か否かを判定させる手順と、
     前記少なくとも一つの第2のメソッドが抽出可能である場合、前記計算機に、前記抽出された各第2のメソッドから直接呼ばれる少なくとも一つの第3のメソッドが抽出可能か否かを判定させる手順と、
     前記少なくとも一つの第3のメソッドが抽出可能である場合、前記計算機に、前記抽出された第3のメソッドを、第1のメソッドに決定させる手順と、
     前記計算機に、前記実行時間を測定させる手順と、前記第2のメソッドが抽出可能か否かを判定させる手順と、前記第3のメソッドが抽出可能か否かを判定させる手順と、前記第3のメソッドを第1のメソッドに決定させる手順とを繰り返し実行させるための性能測定プログラム。
    A performance measurement program that causes a computer to measure the performance of a program,
    The computer includes a processor and a memory that stores a program executed by the processor.
    The performance measurement program is
    A step of causing the computer to first determine at least one first method among methods called directly by the program whose performance is measured;
    A step of causing the computer to measure the execution time of each of the determined first methods by executing the program;
    Procedure for causing the computer to determine whether or not at least one second method that matches a predetermined condition can be extracted from each first method by using the measured execution time of each first method. When,
    If the at least one second method is extractable, causing the computer to determine whether or not at least one third method called directly from each extracted second method can be extracted;
    If the at least one third method is extractable, causing the computer to determine the extracted third method as the first method;
    A step for causing the computer to measure the execution time; a step for determining whether the second method can be extracted; a step for determining whether the third method can be extracted; A performance measurement program for repeatedly executing a procedure for causing the first method to be determined as the first method.
  16.  請求項15に記載の性能測定プログラムであって、
     前記性能が測定されるプログラムは、第1のプログラム及び第2のプログラムを含み、
     前記少なくとも一つの第1のメソッドを最初に決定させる手順において、前記計算機に、前記第1のプログラム及び第2のプログラムの両方によって直接呼ばれるメソッドのうち、少なくとも一つの第1のメソッドを決定させる手順と、
     前記実行時間を測定させる手順において、前記計算機に、前記各第1のメソッドの前記第1のプログラムにおける第1の実行時間と、前記各第1のメソッドの前記第2のプログラムにおける第2の実行時間とを測定させる手順と、
     前記第2のメソッドが抽出可能か否かを判定させる手順において、前記計算機に、前記測定された各第1の実行時間と各第2の実行時間とを用いて、前記所定の条件に一致する第2のメソッドが前記第1のメソッドから抽出可能か否かを判定させる手順とを実行させるための性能測定プログラム。
    The performance measurement program according to claim 15,
    The program whose performance is measured includes a first program and a second program,
    A step of causing the computer to determine at least one first method among methods called directly by both the first program and the second program in the step of first determining the at least one first method; When,
    In the procedure for measuring the execution time, the computer causes the computer to execute a first execution time of the first method in the first program and a second execution of the first method in the second program. Procedures to measure time,
    In the procedure for determining whether or not the second method can be extracted, the computer uses the measured first execution time and the second execution time to meet the predetermined condition. A performance measurement program for executing a procedure for determining whether a second method can be extracted from the first method.
  17.  請求項16に記載の性能測定プログラムであって、
     前記少なくとも一つの第1のメソッドを最初に決定させる手順において、
     前記計算機に、前記第1のプログラムの開始後に開始し、前記第1のプログラムの終了前に終了するメソッドのうち、呼び出し元が前記第1のプログラムの開始前に開始されたか、または前記第1のプログラムの終了後に終了されたメソッドである、少なくとも一つの第4のメソッドを抽出させる手順と、
     前記計算機に、前記第2のプログラムの開始後に開始し、前記第2のプログラムの終了前に終了するメソッドのうち、呼び出し元が前記第2のプログラムの開始前に開始されたか、または前記第2のプログラムの終了後に終了されたメソッドである、少なくとも一つの第5のメソッドを抽出させる手順と、
     前記計算機に、前記第4のメソッドと前記第5のメソッドとのうち、同じメソッドを各第1のメソッドとして決定させる手順とを実行させるための性能測定プログラム。
    A performance measurement program according to claim 16, comprising:
    In the step of first determining the at least one first method,
    Of the methods that start after the first program starts and end before the end of the first program, the caller has started before the start of the first program, or the first A procedure for extracting at least one fourth method, which is a method terminated after completion of the program;
    Of the methods that start after the start of the second program and end before the end of the second program, the caller is started before the start of the second program, or the second A procedure for extracting at least one fifth method, which is a method terminated after completion of the program;
    A performance measurement program for causing the computer to execute a procedure for determining the same method as each first method out of the fourth method and the fifth method.
  18.  請求項15から17のいずれか一つに記載の性能測定プログラムであって、
     前記各第1のメソッドの実行時間を測定させる手順において、
     前記計算機に、前記各第1のメソッドが開始した時刻と、前記各第1のメソッドが終了した時刻とを取得させる手順と、
     前記計算機に、前記取得された各第1のメソッドが終了した時刻から、前記取得された各第1のメソッドが開始した時刻を減算することによって、前記各実行時間を算出させる手順とを実行させるための性能測定プログラム。
    A performance measurement program according to any one of claims 15 to 17,
    In the procedure for measuring the execution time of each first method,
    A procedure for causing the computer to acquire a time at which each first method starts and a time at which each first method ends;
    Causing the calculator to calculate each execution time by subtracting the time at which each acquired first method starts from the time at which each acquired first method ends. Performance measurement program for.
PCT/JP2010/069335 2010-10-29 2010-10-29 Performance measurement method, performance measurement device, and performance measurement program WO2012056569A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/069335 WO2012056569A1 (en) 2010-10-29 2010-10-29 Performance measurement method, performance measurement device, and performance measurement program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/069335 WO2012056569A1 (en) 2010-10-29 2010-10-29 Performance measurement method, performance measurement device, and performance measurement program

Publications (1)

Publication Number Publication Date
WO2012056569A1 true WO2012056569A1 (en) 2012-05-03

Family

ID=45993323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/069335 WO2012056569A1 (en) 2010-10-29 2010-10-29 Performance measurement method, performance measurement device, and performance measurement program

Country Status (1)

Country Link
WO (1) WO2012056569A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014170500A (en) * 2013-03-05 2014-09-18 Toshiba Tec Corp Information processor and program
US10740358B2 (en) 2013-04-11 2020-08-11 Oracle International Corporation Knowledge-intensive data processing system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007249495A (en) * 2006-03-15 2007-09-27 Nec Corp Software verification method, information processor and program
JP2008217721A (en) * 2007-03-07 2008-09-18 Ntt Data Corp Program profiling system, program profiling method, and program
JP2010198133A (en) * 2009-02-23 2010-09-09 Internatl Business Mach Corp <Ibm> Method of selecting function for performance evaluation modeling

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007249495A (en) * 2006-03-15 2007-09-27 Nec Corp Software verification method, information processor and program
JP2008217721A (en) * 2007-03-07 2008-09-18 Ntt Data Corp Program profiling system, program profiling method, and program
JP2010198133A (en) * 2009-02-23 2010-09-09 Internatl Business Mach Corp <Ibm> Method of selecting function for performance evaluation modeling

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014170500A (en) * 2013-03-05 2014-09-18 Toshiba Tec Corp Information processor and program
US10740358B2 (en) 2013-04-11 2020-08-11 Oracle International Corporation Knowledge-intensive data processing system
US11468098B2 (en) 2013-04-11 2022-10-11 Oracle International Corporation Knowledge-intensive data processing system

Similar Documents

Publication Publication Date Title
US10127129B2 (en) Non-invasive time-based profiling tool
US7853929B2 (en) Dynamically profiling consumption of CPU time in Java methods with respect to method line numbers while executing in a Java virtual machine
US7315795B2 (en) Performance analyzing method using hardware
US8572581B2 (en) Measurement and reporting of performance event rates
JP5669630B2 (en) Test case generation method, program and system
US7673287B2 (en) Testing usability of a software program
US8850394B2 (en) Debugging system and method
US9400732B2 (en) Performance regression testing in presence of noise
EP2476059B1 (en) A method and apparatus for determining processor performance
KR100921514B1 (en) A Software Development Apparatus for Providing Performance Prediction and A method thereof
US8584095B2 (en) Test support system, method and computer program product, which optimize test scenarios to minimize total test time
JP6090327B2 (en) Bottleneck detection apparatus, method and program
US20130332913A1 (en) Indirect Software Performance Analysis
US20090083716A1 (en) Profiling method and program
JP6691295B2 (en) Information processing apparatus, program execution state display method, and program execution state display program
JP4879782B2 (en) Program profiling method and program
Fournier et al. Analyzing blocking to debug performance problems on multi-core systems
JP2017167930A (en) Information processing device, power measurement method and power measurement program
JP6995146B2 (en) Performance analysis of adaptive applications
WO2012056569A1 (en) Performance measurement method, performance measurement device, and performance measurement program
CN103838662A (en) Dynamic library profiling method and dynamic library profiling system
JP6544054B2 (en) INFORMATION PROCESSING APPARATUS, EXECUTION INFORMATION RECORDING PROGRAM, AND EXECUTION INFORMATION RECORDING METHOD
JP2016514326A (en) Method and system for analyzing a trace timeline of computer system activity
JP5056479B2 (en) Competitive partial processing detection method, apparatus and computer program
JP2005215816A (en) Performance profiling method using hardware monitor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10858957

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10858957

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP