Monday, April 02, 2007

Profiling an Application

When come to the computer projects, the biggest issue is the emergence of problems after the deployment. This is a real nuisance all the people in the world of computer faces.
So to minimize the effect we can use a process called "Profiling".
By profiling an application we can analyze application execution and identify performance problems like, execution bottlenecks, object leaks, system resources limitations. So by doing so solution provider will be able to chose the right combination of tools and technologies throughout the application life cycle, from development trough production by analyzing the usage of them through out the execution.

Eclipse TPTP (Test and Performance Tools Platform) is profiling tool you can use. As it is an open source project anybody can download from http://www.eclipse.org/tptp .

The easiest way to install TPTP is to use the Remote Update site (see Figure 1). Open the Remote Update window (Help -> Software Updates -> Find and Install->Search for new features to install ->TPTP update site), and select the current TPTP versions and update.

· If you are downloading manually you have to download and install following items.

1. TPTP Runtime or SDK (ALL - Which includes Platform, Monitoring Tools, Tracing and Profiling Tools, and Testing Tools)

2. Agent Controller (For a desired platform)

3. Technology Preview (Automated GUI Recorder)

4. All items listed under 'Requirements'

· You can also download an Eclipse version which includes all TPTP tools.

Where to use TPTP

TPTP can be used form the begging of your application to test the performance of the applications algorithms which implements business logics,

identify methods with high execution time then jump to the source code to fix the performance problem

or you can do it at the end of the project, once the application is almost ready for production.

TPTP lets you test several aspects of your application's behavior, including memory usage (how many objects are being created, and how big they are), execution statistics (where did the application spend most of its time?), and test coverage (how much of the code was actually executed during the tests).

According to the 80-20 rule of thumb, 80% of performance issues will occur in 20% of the code. Or, in other words, you can obtain substantial performance improvements with relatively little effort by simply concentrating on the areas of the application that are executed most often. This is where execution statistics can be useful

How to use TPTP

First run your application so that it will save the last changes and compile the code.

Right click the main class (the class which has the main method) and select profile as -> java application.

You can see the following window there.


Select types of analysis you want. When you press “OK”, program will run and TPTP profiling tools will analyze the execution.

It will display the following window