• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page Loading time in struts

 
paresh doshi
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application a query returns 5000 records. The query execution takes around 2-3 second, but the population of data into bean and arraylist is around 50 seconds. How can i reduce the loading time of the page.

Please help.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you showing all 5000 records to the user at once? Consider using paging. The user is unlikely to look at all those records.

If you need all the records in one shot (say for a download), you could using a streaming download so the download starts while you are processing later records.

To make the whole process faster, use a profiler. Or at least some System.out.println statements to see where the bottleneck is.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the database is on a remote machine, network time may be a factor. You could see if you are returning any unused columns in the query.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic