Forums  > Software  > Becoming a Low Latency Java Developer  
     
Page 1 of 1
Display using:  

Jurassic


Total Posts: 57
Joined: Mar 2018
 
Posted: 2018-05-09 19:43
How do you go from a being a Java developer to being able to do low latency Java development (professionally).

What are the major differences in what you need to know?

What books/texts should you read to get to that level of knowledge (assuming non CS major)?

EspressoLover


Total Posts: 296
Joined: Jan 2015
 
Posted: 2018-05-10 16:28
With the caveat that many smarter and more successful people would disagree with me... why the fuck would you pick Java for low-latency in the first place? Yes, it can be tuned to be nearly competitive with C/C++. But the whole raison d'être for Java over C++ is the streamlined transparency. Garbage collection, memory safety, the JVM, WORA, simplified builds, everything's an object, autoboxing, etc.

That stuff is great, because it lets you disregard a lot of mental overhead, and just have the language/runtime take care of it. E.g. no need to worry about X gets freed because the GC handles it automatically. But when you're trying to squeeze out microseconds, those abstracted convenienced become major pitfalls. Not that you can't develop around them to achieve low-latency, but you have to spend a lot of effort doing so. E.g. how do I avoid triggering the GC in the middle of the hotpath or how do I make sure my JVM isn't interpreting bytecode during critical sections.

Rather than reducing the developer's cognitive burden, these feature are now increasing the design's complexity. You have all the challenge of low-latency programming in a bare-metal language, plus the headache of wrangling Java's bullshit into a context it was never meant for.

Yes, C/C++ is inherently unsafe. But if you really need Java-like safety and memory integrity, I'd say go with Rust. The abstractions in Rust are much more simpatico with the needs of the typical low-latency application.

As to your question about what to study, if you don't have a CS background, I'd suggest starting with the lecture notes or textbook of intro courses in algorithms, OS, compilers, and architecture. Yes, there are specific tricks and hacks to achieving ultra low-latency that won't be covered by these general classes. But 90% of latency is just good design principles, and awareness of how computers actually work. Without this foundation, you're not going to understand the logic behind the hacks anyway.

Good questions outrank easy answers. -Paul Samuelson

HankScorpio


Total Posts: 470
Joined: Mar 2007
 
Posted: 2018-05-11 04:16
Re the JVM GC, etc issues, this could be a solution:

https://www.azul.com/products/zing/

As used by LMAX: https://www.azul.com/successstories/lmax-exchange-2/


EspressoLover


Total Posts: 296
Joined: Jan 2015
 
Posted: 2018-05-11 09:42
I am not a Java expert, but my understanding is that C4 is far from a silver bullet. Pauseless GC is only achieved through encapsulating all objects in read barriers. (The original Azul product had to use custom hardware because of this.) This leads to all kinds of funky performance issues. Code that should intuitively be very fast can run slow for very unintuitive reasons, often during unpredictable corner cases. Allocations also become a lot more expensive with read barriers. Finally keep in mind that while C4 GC is pauseless, the Zing JVM as a whole still has pauses.

I'll stand by my original thesis. If you're already stuck in a JVM codebase, then use Zing. For low latency, it's almost certainly low-hanging fruit. But if you're not, or you have the resources to redevelop, then just use Rust or C++17. The point of a GC is so you don't have to think about it. Even with Zing, we still have to think about GC (and its downstream effects) *a lot*. In contrast, modern-day smart pointers and RAII have pretty much made non-GC memory management painless.

Good questions outrank easy answers. -Paul Samuelson

Jurassic


Total Posts: 57
Joined: Mar 2018
 
Posted: 2018-05-11 13:42
I think there is at least one major bank and one hft firm that use java for low latency stuff

Maggette


Total Posts: 1019
Joined: Jun 2007
 
Posted: 2018-05-11 14:09
Low Lattency and HFT are vague terms...what actualy qualifies as HFT is not clear (at least to me and to some HFT guys I talked to) I know Valo is a prop shop that uses Scala(JVM)...but they are not ultra Low Lattency
https://youtu.be/5znAJPtfu6s

Ich kam hierher und sah dich und deine Leute lächeln, und sagte mir: Maggette, scheiss auf den small talk, lass lieber deine Fäuste sprechen...
Previous Thread :: Next Thread 
Page 1 of 1