We are optimizing a java based website and we have achieve significant amount of performance gain by following points.
(1)On the home page, we were proving a facility to download list of various entities ( Customer, Brand Offices, ect). Previously whenever user want to download any list, a database query was firing. All these queries were not high resource intensive, but if you consider the peak hour resource utilization, they become burden. To overcome by this problem, we are written a Servlet that will run automatically whenever App server booted (Our App Server booted every midnight) and will generate .csv files of various lists. User will be downloading .cvs files, rather then firing queries each time.
(2)At some places we are fetching 100+ records from the DB-Tier to App-Tier. As the default Fetch Size is 10 for many drivers, fetching more no of records takes time. We just did ResultSet.setFetchSize(100) and gain lots of performance.
(3)If you are not worried about Thread, use Thread unsafe Collection object, they are really fast.
This is just to give hint, may be all of this not applicable to your project, but I believe some of them will.
If anybody has their own experience, please same the same.
Thread safe collections are very fast. In most web apps the performance between the two will not be noticeable.
Here are my performance tips.
1) Always measure performance.
Recently, an app team at my client site was going to switch out their relational database to a high speed warehousing product to improve application performance. This would have entailed rewriting application sql, and writing a bunch of code to get data into the warehouse. We measured their app perfomance (using the JAMon servlet filter) and found the poor performance was due to a couple slow queries. They tuned the queries and saved a lot of work. Without measurements they would still be coding.
2) Java is fast. Most performance problems are IO related (db, network, file)