Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

it takes longer time to show the report for the first time

 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have developed an application using RADS. When i searched for the particular report, it takes pretty much time to load the data from database.
Reviewed the query and found tht it is optimized. Also done jsp precompilation option in RADS.
But still it takes longer time to load the screen. Below is the output in milliseconds. Can anyone guide me on this.

For fist time:

time for Query :: 24391 ms
time for coming out of DAO:: 17968 ms
time for coming out of Servlet :: 23968 ms

For second time
time for Query :: 4391 ms
time for coming out of DAO:: 7968 ms
time for coming out of Servlet :: 7968 ms
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your query do? Does it create any temporary tables or similar stuff that won't happen the second time? Is there any caching involved? Any more details you can give us?
 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using query to feteched the data from DB2. No temporary table is used. Fetcing data using simple joins and with some run time parameters.
 
Sergey Babkin
author
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably on the first run all the related data and code gets loaded from disk into the caches, and does any other set-up tasks like opening teh connection, compiling the query etc., and then it runs from memory over the already established connection. It happens everywhere, the first time something runs is always slower. You can try to optimize by keeping as much of existing infrastructure open between the calls and reusing it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic