Category Archives: Java

Tungsten FSM: A lightweight Java finite state machine library

I recently came across Tungsten FSM whilst looking for an off the shelf FSM implementation. Ideally I was looking for something which was a lightweight and no-frills but robust FSM implementation, and Tungsten FSM seemed to exactly fit the bill. All configuration is done in code, so no messing around with XML files, and the […]

A-Team London Insight Exchange

Myself and a colleague were offered some tickets for the A-Team Insight Exchange (High Performance Technologies for Trading and Risk) in London yesterday, and were able to get away from our desk long enough to attend the first half of the day! Overall a lot of the things discussed were things that we were already […]

Garbage Collection Tuning

I recently stumbled across a useful presentation: “GC Tuning In the HotSpot JVM” from FISL 10, which provides a good overview of how to tune the ParNew, Paralell and CMS collectors… Also quite useful is this blog entry which explains how to understand CMS GC logs.

Performance techniques used in the Hotspot JVM

Little gem from the Hotspot Internals wiki helping to solve puzzles such as is “X.class.isAssignableFrom(obj)” slower than “obj instanceof X“! Performance techniques used in the Hotspot JVM.

Calculating floating point epsilon/precision in Java

Floating point arithmetic/rounding can be somewhat painful, made worse by the fact that the epsilon (error) in the machine representation of floating point varies depending on the exponent (i.e. how large/small the number being represented is): Normalized numbers when Base = 2, Precision = 3, Exponents = -1 to 2 [Goldberg91] A very comprehensive paper […]

JMM Synopsis

Useful synopsis of the Java Memory Model from Doug Lea – in particular the clearest explanation I have found so far of the meaning of “happens-before”, and some useful definitions which helped to get a concrete idea of the semantics around safe-publication of variables through Thread.start()…

Java Concurrency Refcard

A handy concurrency refcard from Alex Miller is now available on DZone. Most of this should be second nature for experienced Java developers, but it provides a handy summary of concurrency and reminders of some of the less frequently used (and hence more easily forgotten) classes like ConcurrentSkipListSet, Atomic*Array etc.

NonBlockingHashMap

Just came across this, looks like it has been around on Sourceforge for a while as part of lib-high-scale. Designed for large numbers of CPUs (e.g. Azul hardware), but microbenchmarks claim a small improvement over ConcurrentHashMap even on 2 CPUs.