Postingan

Menampilkan postingan dengan label Java Performance

Improving Performance of java application

This is a big topic to discuss as there are many approaches which involve analyzing performance of an application starting from profiling application to finding the bottleneck. here I am putting some of the basic tricks for improving performance which I learned in my early days in java , I will keep posted some approach , experience on performance improvement as and when time allows. for now here are naive's tips for making your program run faster. 1. Use bit shift operator for multiplying and divide by 2 , computers are very fast with the bitwise operation. 2. Use StringBuffer in place of the string if you are doing lots of string manipulation it will reduce memory by avoiding creating lots of string garbage. If you are using java5 then consider StringBuilder but that is not synchronized so beware. 3. try to make variable , class , method final whenever possible that allows compiler to do lots of optimization e.g. compile time binding so you will get faster output. 4. static metho...