• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does JSP precompilation increase performance?  RSS feed

 
kode venugopal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one doubt,Is Jsp precompilation increases the performence of the application?.
What is the exact difference of using jsp and precompiled jsps ?

Thanks,
Venu.
[ January 20, 2006: Message edited by: Bear Bibeault ]
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not Precompiling JSP(s) increases the response time only for the first request. For subsequent requests the response time is not long (as now the JSP has been compiled (that is pre compiled).

If you care that even for the very first customer response time should be less , precompiling is required.
[ January 20, 2006: Message edited by: karthi keyan ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSPs are compiled the first time they are accessed after a web app restart. This happens just once, and then never again (until they're changed). Precompiling will compile JSPs right after the web app is restarted (or possibly even before that), so you don't have to wait the first time a page accessed. So the performance benefit is really a one-time thing for the very first person to access the page (who doesn't have to wait for compilation). It does not improve overall application performance.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on the container you are using, declarative precompilation is also possible. This means that a Web application (standalone or as part of an EAR) can be configured so all of its JSPs are precompiled during application deployment (at server startup) and redeployment (at runtime).

But not only can this take a long time for big apps, another problem with compiling declaratively or on demand is that an error may occur. This is a serious drawback, so programmatic precompilation (using JSPC) is highly preferable. You'll discover any compilation errors before the users and you can deploy the compiled code multiple times.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!