JSP Performance Troubleshooting

I am running into some performance problems with my JSP application. We are using JRun as the server. My page is executing a stored procedure in SQL Server, storing the data from the resultset in an arraylist of objects that I created to store the data and displaying the data in increments of 50 in an html page. I store the arraylist as a session attribute.

In one particular example the resultset is 278 records. The stored procedure takes about a second to run using the Query Analyzer. The page takes several minutes to display.

Does anyone know where I should begin to look to improve the performance of this page? I could post the code from the page, but I didn't want to just throw that out there without a specific question about it.

Thanks for your time.

Matt

[801 byte] By [matty1stopa] at [2007-10-2 21:36:27]
# 1

If you are facing this problem for large amount of records that you are trying to retrive and trying to do tha pagination in jsp then you may also think in this following way to to improve performance.

I'm not sure how far it will be useful for you but its just my idea.

1.First dont keep the ArrayList object in session.

2.dont retrive all records and retrive only current page rows from database that you want to display on the jsp

3.when you click next for pagination again retrive only current page rows.

let me know if you need more info

kssra at 2007-7-14 0:50:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Well a cheap way to profile a piece of code is to put in some timer printouts. Keep track of a previous time and a current time and at certain parts in the code print out the difference between the two. Then you can easily see what part of your code is taking way to long to execute.
gimbal2a at 2007-7-14 0:50:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
P6spy is a great tool for troubleshooting database performance issues.
jleecha at 2007-7-14 0:50:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...