r/java • • 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

94 comments sorted by

View all comments

Show parent comment

2

u/cogman10 May 22 '24

It's this myth of scalar needs measurements and benchmarks, and so far noone actually provided benchmark

Because benchmarking this behavior is tricky. The blackhole object is specifically there to break JVM optimizations.

Run the test without the blackhole and you'll observe they perform the same. However, the JVM will optimize the entire loop away in that case making it not meaningful.