Help Needed in Understanding TPTP Profiling Results
I am new to Profiling . i decided to start with Eclipse TPTP as its looks simple and easily configurable
I started with this basic APplication
public class As {
public static void main(String args[]) {
Two t = new Two();
t.two();
}
}
=====================
public class Two
{
public void two() {
System.out.println("Two");
}
}
==============
After running the Profiler on As.java using Profile As JavaApplication . The screen开发者_如何学JAVA shot appeared in this way :
Please see the screen shot here
http://imageshack.us/f/11/shareb.jpg/
Please let me know what is meant by Base Time , Average Base Time and Cumulative Time .
Base Time: The amount of time (in seconds) the method has taken to execute. Not including the execution time of any other methods called from this method.
Average base time: The average base time required to execute this method once.
Cumulative base time: The amount of time (in seconds) this method took to execute. Including the execution time of any other methods called from this method.
Calls: The number of times this method was invoked.
You may want to have a look at the following Tutorial, where this information is located: An introduction to profiling Java applications
The information that's actually useful is cumulative time as a percent of total time. That is the percent of time the routine is on the stack, i.e. either executing itself or calling other functions, regardless of how many times it is called.
The reason that number is useful is because if such a function could be speeded up by a large amount, that percent tells you how much the total time could be reduced.
For example, if routine A has a cumulative percent time of 10%, then even if you could reduce its time to zero, the total time would only go down by 10%. To make software go faster, you have to find routines of high cumulative percent that you can squeeze, often by doing fewer calls to subroutines.
Call counts and average execution time of routines is only useful to the extent that it helps you figure out cumulative percent. Also, the precision of the measurement is not really important except to help you locate the functions you want to optimize. When you optimize a function, the amount of time saved is what it is, regardless of how carefully it was measured beforehand.
精彩评论