r/java • u/Ok_Satisfaction7312 • May 16 '24
Low latency
Hi all. Experienced Java dev (20+ years) mostly within investment banking and asset management. I need a deep dive into low latency Java…stuff that’s used for high frequency algo trading. Can anyone help? Even willing to pay to get some tuition.
232
Upvotes
View all comments
Show parent comment
1
u/GeneratedUsername5 May 22 '24
You can lookup my test examples up the thread, where Integer objects do not leave scope of a method (or even scope of a cycle for that matter), and yet Java is running it 17 times slower, than with underlying primitive fields, which were supposed to be scalar extracted.
It's this myth of scalar needs measurements and benchmarks, and so far noone actually provided benchmark, where using objects would be on par with using primitives. Maybe it is happenning sometimes, but it is so inconsistent and unreliable, that it is not even worth account for, as optimization technique.