Minggu, 09 Februari 2014

Improving Performance of java application



This is a big topic to discuss as there are many approaches which involves to analyze performance of an application starting from profiling application to finding bottleneck.



here I am putting some of the basic tricks for improving performance which I learnt 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 bitwise operation.



2. Use stringbuffer in place of 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’s allow compiler to do lots of optimization e.g. compile time binding so you will get faster output.



4. static methods are bonded compile time while non static methods are resolved at runtime based on object type so static method will be faster than non static.



5. don't call methods in for loop for checking condition e.g. length() size() etc.

instead of doing this , use modified version




for(int i=0; i

int size = vector.size();
for(int i=0; i



if you like to know about FIX protocol and its usage in Electronic trading or Derivatives trading e.g. Futures and options , foreign exchange and other asset class , Please see my FIX Protocol Tutorials series. I have shared my experience in investment banking and finance domain as form of short tutorial and could be used as start guide for any one new in FIX protocol and can compliment official FIX Protocol Technical specification in simple words.



If you are going for any FIX Protocol Job Interview you can quickly benefit from my FIX Protocol Interview Questions, those are questions mostly asked in Interview for a FIX developer position. It not just help in as quick reference for Interview but also opens new area of learning for new comers.



hope this would be useful.
























Source:http://javarevisited.blogspot.com/2010/10/improving-performance-of-application-in.html

Tidak ada komentar:

Posting Komentar