Profiling is a set of techniques for estimating the amount of time spent in various portions of your program.
The size of the program unit being profiled is called the granularity.
For example, you can profile
Routines
Loops
Statements
Addresses
The profile will tell you how much of the execution time can be attributed to each grain you have selected. The most common grain is routine level profiling.
The output of a profiler indicates what fraction of the execution time was spent in each grain.
Presumably, to improve performance, you focus on the grains that are taking the most time.
Any tool which will enable you to do profiling of your program is a Profiler.
There are several commercial as well as open source java profilers.
(http://java-source.net/open-source/profilers)
Using Java profilers you can do profiling of a Java Application, Applet, J2ee components like servlets and JSPs and even J2me Midlets.
My experience with profiling has been plain old logging statements weaved in the production code and using JProfiler (a commercial Java Profiler) .
http://www.ej-technologies.com/products/jprofiler/overview.html
I have recently used JProfiler for profiling a J2ee application. I am very impressed with its easy to use wizard to integrate with any J2EE application server. I could easily integrate the Resin application server with this tool. The “cpu view” section of the profiler gives information about the method level profiling, about the threads in different states in the application. You can read about some reviews about this tool on
http://weblogs.java.net/blog/simongbrown/archive/2005/02/jprofiler_minir_1.html
I have managed to dig out some of the methods to concentrate on to improve the performance of the application.
All in all JProfiler is a very useful and easy to use tool …definitely not another buzzword for my CV. ;-)
1 comments:
Good intro to JProfiler. Need to explain more uses.
Post a Comment