The question I am trying to answer is what does it take to get Java to perform so fast it blows women's cloths off. The goal is not to understand what is fast - but simply to look at techniques which are faster than anything else available.
1. Never use java.util (collections). They generate tremendous amount of garbage and are slow.
DemiGods in this space -
1. Never use java.util (collections). They generate tremendous amount of garbage and are slow.
- Trove
- Colt
- If you don't believe me - http://b010.blogspot.nl/2009/05/speed-comparison-of-1-javas-built-in.html
- http://docs.oracle.com/cd/E19900-01/819-4742/abeik/index.html - No minor GC collections until Eden fills up - so make your Eden larger. (-XX:MaxNewSize)
- http://java-performance.info/overview-of-memory-saving-techniques-java/
- http://java-performance.info/string-intern-in-java-6-7-8/
- https://github.com/OpenHFT/Java-Lang/blob/master/lang/src/main/java/net/openhft/lang/pool/StringInterner.java - very quick way to do on heap intern
- http://logging.apache.org/log4j/2.x/manual/async.html
- https://github.com/OpenHFT/Java-Chronicle - record everything for high-frequency-trading (read fast enough to blow women's cloths off)
- https://github.com/OpenHFT/HugeCollections - off heap storage
- https://github.com/OpenHFT/Java-Lang
- http://www.azulsystems.com/jhiccup - unexplained processing pauses
- http://dtrace.org/blogs/brendan/2013/06/08/linux-performance-analysis-and-tools/ - tools to monitor Linux
- http://www.joyent.com/blog/the-new-systems-performance - some more tools
- http://lmax-exchange.github.io/disruptor/ - inter thread message passing.
- https://github.com/hajile/microclock - library implementing RDTSC (let's count the CPU clock cycles)
- http://www.strchr.com/performance_measurements_with_rdtsc
- https://github.com/giltene/HdrHistogram - more precise measurements
- Write code that is easy for the optimizer - https://wikis.oracle.com/display/HotSpotInternals/PerformanceTechniques
- https://github.com/OpenHFT/Java-Thread-Affinity - Thread affinity
- http://www.docjar.com/docs/api/sun/misc/Unsafe.html - a magical class in the JDK, which does everything a magnitude faster, but don't use it without protection. It's unsafe.
- http://architects.dzone.com/articles/getting-cc-performance-java - serialization using Unsafe
- http://java.dzone.com/articles/lock-based-vs-lock-free - no locks is a lot faster than with locks (no shit).
- http://www.infoq.com/articles/memory_barriers_jvm_concurrency - use volatile but only at your own risk
DemiGods in this space -
- http://mechanical-sympathy.blogspot.com/ - LMAX Tech Architect Guy
- http://vanillajava.blogspot.com/ - HFT Java Guy