Here are a few tips to improve JSP performance that I have been using. If you have your own listing of the tips, plz share.
Disable JSP auto reloading feature.
Use thread pool for your JSP engine and define the size of thread pool as per application requirement.
Use jspInit() method to cache static data
Initialize the 'out' object (implicit object) with proper size in the page directive.
Set the content length
Give 'false' value to the session in the page directive to avoid session object creation.
Flush the data partly
Use StringBuffer rather than using + operator when you concatenate multiple strings
Use include directive instead of include action when you want to include the child page content in the translation phase.
Avoid giving unnecessary scope in the 'useBean' action.
Use print() method rather than println() method
Use ServletOutputStream instead of JSPWriter to send binary data
Minimize code in the synchronized block
Do not use custom tags if you do not have reusability.
Use 'session' and 'application' as cache.
Remove 'session' objects explicitly in your program whenever you finish the task
Use caching tags provided by different organizations like openSymphony.com
Reduce session time out value as much as possible
Release resources in jspDestroy() method.
Comments
See http://www.karstenvoges.de/blog/archives/2004/06/17/howto_comments_in_jsps.html