Performance improvement of a Java application
by, 01-08-2012 at 01:45 PM (3426 Views)
Follow these steps to improve performance of your Java application.
• Always Pool valuable system resources like threads, database connections, socket connections.
• Optimize your I/O operations by using buffering when writing to and reading from files and/or streams.
• Minimize network overheads by retrieving several related items simultaneously in one remote invocation if possible.
• Apply the following performance tips in your code
• Use ArrayLists, HashMap as opposed to Vector, Hashtable
• Set the initial capacity of a collection.
• Minimize the use of casting or runtime type checking like instanceof in your code.
• Do not compute constants inside a large loop.
• Avoid using System.out.println.
• Minimize calls to Date, Calendar, etc related classes.
• Minimize JNI calls in your code.