• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic vs Static include  RSS feed

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been googling about reading up on the difference between jsp:include and @include. Most sources mention that static include makes class files bigger but eliminates some overhead at display time. We're being whipped to improve performance ... is converting dynamic includes of child JSP pages to static worth the effort?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Results would be positive, but not thinking a real gain.

If that page, which is changed to a static include, is gonna display something really heavy then may be its worth it. But what makes the page heavy, images/graphics?
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed most of our static includes to dynamic with no noticeable drop in performance.
If anything some very complex pages (which were running up to the limit of what a JSP page can get, 64KB sourcecode in the generated service method) seem to load faster than before.

The added benefit that changes to shared fragments can be implemented without needing to force a recompilation of every JSP makes the choice even simpler.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're being whipped for performance, request that you company buy you either jProbe or Optimizeit. Profile your app to find out where the bottlenecks actually are in your app.
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more thing i wish to add is :
if we change static to dyanamic pages, you can't access varibles in the parent page to the included page. This is a maintenance isssue if we do static to dyanamic switch

Regards
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't use scriptlets anyway so if you have your JSPs properly architectured there should be no problems...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!