Tips for improving the performane of Java applications
- Use Native Methods: The small amount of overheads caused by JNI is usually outweighed by the improved speed of the native function
- Use Buffering on I/O Operations:
BufferedWriterreduce the number of I/O operations to be performed.
- Avoid Creating New Objects: Reuse objects as much as possible. The more objects, the more memory to create/store them.
StringBufferinstead of String Concatenations
SynchronizedMethods and Blocks
Hashtableare heavily synchronized for thread safety, while
HashMap(which provide similar functionality) are not. You can make these
Collectionclasses thread safe by calling static methods within the
Collectionclass that create a thread-safe wrapper around a collection.
- Use Resource Pooling for Threads, Databases and Network connections
- Make Methods
Private: These enable static binding, which is faster than dynamic binding.
- Minimise Subclasses and Method Overriding
What did I say then?
Hacking Asterisk and Rails with RAGI | Joe Heitzeberg at O'Reilly (7 years 19 weeks ago): ......I'll provide a quick overview of how Asterisk, the open source PBX, can be used as a general-purpose "telephony protocol server," and can be connected to Ruby on Rails to create a rapid prototyping environment for creating next-generation VoIP applications and services....... http://www.oreillynet.com/