Java Vibes..

June 22, 2009

Application Performance Optimization Tips

Filed under: java tips — harjitdelhi @ 4:44 pm
Tags:
In my experience, mostly database is the bottleneck, so the prime objective should be to optimize queries and to reduce the number of database calls and bring as much data together as possible.
1. Try to bring multiple result sets together from the database, use Stored procs if needed.
2. Use JDBC batch updates to club together multiple database updates in a single database call.
3. Use Java caching of results wherever possible (using caching libraries, static variables etc).
4. Another possibility is to use static db views / summary tables, which can be nightly refreshed etc.
5. Appropriate use of indexes in db tables can make a lot of difference, especially in case of complex joins etc.
6. Reduce the amount of Java reflection being used in code or cache the reflection stuff.
7. Do selective logging, check if log enabled before issuing a log statement.
8. Tune app server params like increase connection pool size, -Xms, -Xmx, -XX:PermSize, -XX:MaxPermSize etc.
9. Consider appropriate clustering of app servers, JMS queues etc and asynchronous execution of complex jobs (using JMS) etc
10. Use optimized XML parsing, serialization libraries etc.
Using good profiling tools to find out pain areas is extremely important.
In my experience, mostly database is the bottleneck, so the prime objective should be to optimize queries and to reduce the number of database calls and bring as much data together as possible. Using good profiling tools to find out the pain areas is extremely important.
  1. Try to bring multiple result sets together from the database, use Stored procs if needed.
  2. Use JDBC batch updates to club together multiple database updates in a single database call.
  3. Use Java caching of results wherever possible (using caching libraries, static variables etc).
  4. Another possibility is to use static db views / summary tables, which can be nightly refreshed etc.
  5. Appropriate use of indexes in db tables can make a lot of difference, especially in case of complex joins etc.
  6. Reduce the amount of Java reflection being used in code or cache the reflection stuff.
  7. Do selective logging, check if log enabled before issuing a log statement.
  8. Tune app server params like increase connection pool size, -Xms, -Xmx, -XX:PermSize, -XX:MaxPermSize etc.
  9. Consider appropriate clustering of app servers, JMS queues etc and asynchronous execution of complex jobs (using JMS) etc.
  10. Use optimized XML parsing, serialization libraries etc.
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: