Forums Register Login

Slow Loading JSP

+Pie Number of slices to send: Send
I have a JSP page that returns results from a query. When the number of results is large, the page loads slowly. I tried stripping out all of the iteration logic and only displaying summary data (data that is displayed once per page), but it still loads slow. Here is a snippet of the summary data:



The properties shown above on reportBean are Strings. ReportBean is in request scope. A TreeMap property that is not being outputted on the page contains most of the results of the large query. Any ideas?
+Pie Number of slices to send: Send
How large is large? 100? 1000? 10000?

What exactly consumes the most time? Run a profiler. How long does the request-response cycle at the server side take? (this to exclude the render time of the webbrowser at the client side)
+Pie Number of slices to send: Send
The test data I am using has over just over 10,000 items. It is possible to have many more results (on the order of 100,000). When the TreeMap containing the majority of the results isn't populated, everything runs quickly. It is only when the TreeMap is populated that everything slows down (even when the TreeMap isn't output to the screen). I will see if I can't setup a profiler to get more specifics.
+Pie Number of slices to send: Send
When using JSF please post any questions in the JSF forum. I've moved this one there.
+Pie Number of slices to send: Send
 

Andy Holm wrote:The test data I am using has over just over 10,000 items. It is possible to have many more results (on the order of 100,000). When the TreeMap containing the majority of the results isn't populated, everything runs quickly. It is only when the TreeMap is populated that everything slows down (even when the TreeMap isn't output to the screen). I will see if I can't setup a profiler to get more specifics.

Why that lot at once? Where does that information come from? What do you need it for? I can't imagine that one would like to see all the 10,000 or more at once. At highest 100 is a respectable limit when viewing data at once. The remaining data could just be accessed by paging techinques.
+Pie Number of slices to send: Send
That is definitely a lot of data. however, as you mentioned, it seems like the slowdown actually occurs in the process that populates the treemap.
+Pie Number of slices to send: Send
Also, to my experience, in case of those amounts of data, the biggest bottleneck is the webbrowser used at the client side.

Let's give a rough example: when using decent hardware and network, transferring 10,000 records from a well-indexed SQL database into Java's memory using well-written Java code shouldn't last more than one second. Letting JSF to render a table with that amount of rows shouldn't last more than two times of the time the DB needed to return the records, so it's at highest 2 seconds. The total time of request-response cycle should be not more than 3 seconds. You can easily test it using a Filter:

Once the response is completed, left behind the render time of the webbrowser used at the client side. To experience, MSIE is the slowest in this and Opera is the quickiest in this. Depending on the webbrowser and the hardware of the client machine used, the render time could roughy range from 3 seconds up to 10 seconds or even (much) more.

With regard to effective pagination, you may find this article useful: http://balusc.blogspot.com/2008/10/effective-datatable-paging-and-sorting.html
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2826 times.
Similar Threads
404 Error
servlets/jsp
Struts action not returning page on first click of button
Retrieving data using iterate and eliminating duplicate values
Problem getting values from JSP to JSF Bean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:11:41.