Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

why does My JSPs are taking very long time to load

 
pioneer
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

i have written so some jsp that will work as window.open .

But why does my jsp take long time to load

My JSp are taking very long time to load (Actually this consists of some combo boxes where the data needs to be filled in from the database itself)

Any suggestions would be helpful.
 
master steward
Posts: 6554
1203
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be something to do with the way that you handle the database. Which component you used to connect with the database?
 
Ravi Kiran Va
pioneer
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
simple JDBC.
 
pioneer
Posts: 1871
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Some things I would look for

1) Precompile jsp ( for first time loading time)
2) put in some Timers in the jsp page and output them in the html to find out which part of the jsp takes time
3) Cache data retreived from the db so that the next time the db is not accessed anymore.

Br
Rahul P. Mahindrakar
 
Ravi Kiran Va
pioneer
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah , valuable tips .thanks
 
gardener
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rahul Mahindrakar wrote:Hi

Some things I would look for

1) Precompile jsp ( for first time loading time)
2) put in some Timers in the jsp page and output them in the html to find out which part of the jsp takes time
3) Cache data retreived from the db so that the next time the db is not accessed anymore.

Br
Rahul P. Mahindrakar



I would not bother with 3 unless:
  • Your business logic can tolerate the cached data
  • You know it is recovering data from the database that is to blame


  • Look for the obvious stuff first: what is causing the bottleneck? Is the CPU at 100%, or is it doing nothing and (probably) waiting for IO? Is your JVM running out of memory? If you run the same query in another client on the same machine, is it slow too? If you run the database locally is it much quicker? Do you return loads of results from your database? Do you need them all? Have you profiled the query in your database? Does it suggest any indices?

    If nothing jumps out from that, I would profile your application itself, see if there are any hotspots.
     
    Rahul Mahindrakar
    pioneer
    Posts: 1871
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    HI

    We had a similar problem in one of my projects where there was a country dropdown and it was being retrieved .1 million times a day.

    This query started appearing in the Oracle reports causing some embrassment.

    We decided to cache the data for 30 minutes which was always ok.
    ---
    The timers are relevant because they are able to help isolate the problem area on the jsp. I guess you could easily develop a tag library to help you on performance in your project.

    Br
    Rahul P. mahindrakar
     
    Ravi Kiran Va
    pioneer
    Posts: 2234
    Eclipse IDE Firefox Browser Redhat
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Paul ,

    no cpu is not busy .
    No JVM also working fine .
    I think i need to modify the database query . (I will try this)

    If nothing jumps out from that, I would profile your application itself, see if there are any hotspots.



    Can you please tell me how to do this .I am using MyEclipse IDE.
     
    pioneer
    Posts: 862
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    you can use the jamon jdbc proxy driver. It is a wrapper for your jdbc driver that times all queries that you issue and let you view the results. jamon doesn't require you to change your code.

    Here is how it works. http://jamonapi.sourceforge.net/#WhatsNew22
     
    Ravi Kiran Va
    pioneer
    Posts: 2234
    Eclipse IDE Firefox Browser Redhat
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you.
     
    My cellmate was this tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!