Low latency programming

Sambatyon picture Sambatyon · Jul 31, 2009 · Viewed 35.1k times · Source

I've been reading a lot about low latency financial systems (especially since the famous case of corporate espionage) and the idea of low latency systems has been in my mind ever since. There are a million applications that can use what these guys are doing, so I would like to learn more about the topic. The thing is I cannot find anything valuable about the topic. Can anybody recommend books, sites, examples on low latency systems?

Answer

Adamski picture Adamski · Nov 8, 2010

I work for a financial company that produces low latency software for communication directly with exchanges (for submitting trades and streaming prices). We currently develop primarily in Java. Whilst the low latency side isn't an area I work in directly I have a fair idea of the skillset required, which would include the following in my opinion:

  • Detailed knowledge of the Java memory model and techniques to avoid unnecessary garbage collection (e.g. object pooling). Some of the techniques used might typically be regarded as "anti-patterns" in a traditional OO-environment.
  • Detailed knowledge of TCP/IP and UDP multicast including utilities for debugging and measuring latency (e.g. DTrace on Solaris).
  • Experience with profiling applications.
  • Knowledge of the java.nio package, experience developing NIO-based scalable server applications, experience designing wire protocols. Also note that we typically avoid using frameworks and external libraries (e.g. Google Protobuf), preferring to write a lot of bespoke code.
  • Knowledge of FIX and commercial FIX libraries (e.g. Cameron FIX).

Unfortunately many of the skills can only be developed "on the job" as there's no substitute for the experience gained implementing a price server or trading engine based on a spec. from an exchange or vendor. However, it's also worth mentioning that our company at least tend not to look for specific experience in this (or other) niche areas, instead preferring to hire people with good analytical and problem solving skills.