Originally posted by Venkatesh Rajendran:
We feel our website seems to be very slow, it would be great if you could tell me any other methodologies to improve the performance.
The quickest/easiest way to improve performance: Get better hardware. Hardware is cheap compared to spending months of developer time chasing bottlenecks. I once had a client who complained about a Java web app's performance. Turns out he was trying to run the app server on a dual Pentium 166 with 256megs of RAM that, without the web app running, had a 90% CPU load. Enterprise applications require enterprise-level hardware. We ran the same app with a dual Itanium 800 with 2gigs of RAM (cost about $10k in the year 2000, about the same as a man-month for a developer) and the performance problems went away. Use whatever your platform provides (top on Linux, Task Manager/System Monitor on WinNT/2k/XP) and see if your hardware is maxed out.
Converting to Struts will probably not increase performance. Depending on your current architecture, Struts may make it perform _worse_. Struts performs at least on forward per request, in some cases more. What Struts does do is give you a good framework to build a web application using an MVC architecture. It also decouples the presentation logic from the business/persistence layers so the workflow of the web app is more flexible and it is easier to spread the load across multiple developers.
Try using a profiler like JProbe or Optimizeit to identify bottlenecks in your program. If the bottlenecks aren't in your controller servlet (i.e. the bottlenecks are database calls or jsp page rendering), converting to Struts won't impact the bottlenecks at all. Concentrate only on those areas where your program performs worst. If it is a database call perhaps adding an index to a central table will help, or caching results for tables that don't change often. If the bottleneck is in some Java code, look for the obvious: creating object instances in a loop, using String+String where
you should use StringBuffer.append() and so on. There's a bunch of information at
Java Performance Tuning Tips. Be warned that performance tuning on maxed-out hardware will probably not yeild significant results unless you have some really bad code!