• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to get faster page loads

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have noticed that it takes a long time for the pages in my app to load the first time. The action class executes quickly and it takes at least 6 to 10 seconds to render the page after that. I am using struts and jstl tags (struts 1.2.9) and no custom tags.

My application uses tiles. And each tile in a jsp imports struts/jstl tag libraries. Each jsp page has about 4 to 5 tiles. I understand that the first time the page is called, it is compiled. But isn't 10 seconds long for displaying a page?


Is it the taglib imports in each tile that is slowing down the process? Is there anyway i could import the taglibs only once instead of calling them for each tile in the layout?

Thanks
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maya Thomas,

I've done few R&D in this and finally i came to conclusion that these problems are due to JSP's.

While you Build the Application the JSP's will generate class files for all the JSP's. Check the EAR/WAR file for the Class files of all the JSP's and then Deploy the application.

The Reason : After the Application is deployed in Prod/Pilot Server when you try to click on some JSP, the Jsp will actually try to create a class file for the same and because of that it takes time to load. so instead you create the Class files even before Deploying the EAR/WAR file in Server.

Steps in RAD to create the Class Files in JSP:
1. Right the Web Project under the Dynamic Projects for "Properties", here there is a option called "JSP Compilation".
By Default the "when Server Displays page" options will be chosen, Change the option to "when project is built in workspace" and chek the checkbox.
This will lead you to create the Class files of JSP's.

Regards,
KMR
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The original post doesn't contain enough information to conclude that the problem is due to JSPs. It could just as well be that the application logic or database access is taking a while. The first step in diagnosing this would be to determine what is taking up how much time. Then one can start addressing it.
[ March 11, 2008: Message edited by: Ulf Dittmer ]
 
Maya Thomas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf,
I came to the conclusion that the problem is with the JSP is because the first time page load is always slow and the subsequent calls are fast.

Rajan,
Forgive my ignorance, but is RAD your appliction server or something like ant?
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A 10 second lag sounds about right for the time required to translate your JSP into Java code and then compile the generated Java code. Most application servers have a way to precompile your JSP files so that user's do not see this delay.

- Brent
 
rajan Kayarohanam
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maya,

RAD - IBM Rational Application Developer, its an IDE for developing Applications.
IBM Rational Application Developer (RAD) is the new generation of Java application development environments built on the Eclipse open platform.

The Steps which i gave is to do the Pre-Compilation of JSPs in RAD IDE.
For More info:
Info on RAD

what is the IDE you are using to develop your application?
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic