3 ms·
When I worked in HFT with Java code, creating caches/pools of commonly used objects (generally serialized/deserialized real time parameter updates) was pretty c
by nvarsj 4y ago
When I worked in HFT with Java code, creating caches/pools of commonly used objects (generally serialized/deserialized real time parameter updates) was pretty common. It significantly reduced memory allocation in hotspots. But the better benefit, generally, was substantially reduced GC pause times.
Java was used back in the 2000s because it was seen as the cool kid. More productive than writing C++ and easier to hire and train for.
- smabie 4y agoNot that many Java systems remain for HFT.
- kaba0 4y agoDepends on the type of HFT. On one end, not even C++ cuts it and FPGAs are used, while on the other hand I heard of plenty of Java deployments. Sure though, HFT itself is a niche.
- aasasd 4y agoYeah, afaik HFT folks also disable GC and just restart the app, or even the machine, at the end of the day. Java game devs are also fond of object pools, to my knowledge: they do as much allocation as possible at the start of a game level, and then avoid it until the level ends.
- nvarsj 4y agoYep that was what the critical loop trading components did (the ones w/ the models for buy/sell hooked up to the exchange feed). Completely disable GC and restart it every day. Every line of code in those critical loops was pored over to make it as fast as possible. These days it is a lot of FPGA based stuff but I like to believe the JVM stuff is still running somewhere.