Building high performance Java application (Lessons Learnt)
2 min read read
Whilst on training abroad last month, I had the opportunity of building an automated rates trading system in Java from scratch to compete with systems built by the other teams.
Surprisingly, this opportunity has turned out to be a great learning experience for me building a high performance application. My team did well in terms of performance and here are some of the lessons I learnt in the 2 weeks.
long
/double
instead of BigDecimal
for monetary calculationdouble
to BigDecimal
, convert using a string
insteadsynchronisation
where possibleLinkedList
, add/remove elements from the endConcurrentHashMap
, Use (link: https://github.com/boundary/high-scale-lib text: NonBlockingHashMap
) insteadDisruptors
) are fasterjava -server
java -XX:+OptimizeStringConcat
java -verbose:gc -Xloggc:<filename>
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintTenuringDistribution
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCApplicationStoppedTime
Comments