J2EE application performance optimization

How to extract maximum performance from your J2EE Web applications

1 2 3 Page 3
Page 3 of 3
  • Keep the transactions as short as possible. The longer a transaction is open, the longer it holds the locks on the resources acquired, and every other transaction must wait.
  • Do not use DISTINCT clauses unnecessarily. If you know the rows will be unique, do not add DISTINCT in the SELECT clause.
  • When possible, avoid using SELECT *. Select only the columns from which you need the data.
  • Consider adding indexes to those columns causing full-table scans for your queries. Indexes can result in a big performance gain, as shown above, even though they consume extra disk space.
  • Avoid using too many string functions or operators in your queries. Functions like SUBSTRING, LOWER, UPPER, and LIKE result in poor performance.

Summary

In this article, I barely scratched the surface of performance tuning. Just reading this article will not make you an expert on all aspects of performance. But I hope you have gained a better appreciation for the methodology and acquired enough knowledge to be able to start the process. For optimum results, you need to tune every aspect of the application starting with the bottlenecks. Even experienced developers make small mistakes that prove costly in terms of performance. Performance tuning helps to identify these mistakes and makes your product not only more scalable, but also more reliable under stress conditions.

Rahul Kuchhal is a software architecture manager with Synygy's performance tuning group. He holds a master's degree in computer science with specialization in network communications. He has been involved in designing and developing large-scale projects in performance management, telecommunications, and banking industries for more than seven years now. These days, as the manager of a performance tuning group, he works full time on all things performance.

Learn more about this topic

1 2 3 Page 3
Page 3 of 3