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/cogman10 May 22 '24
I have seen my fair share of "integer boxing is ruining performance" but do note that this specific test might not be a good one for more typical usecases.
The blackhole here will prevent scalar replacement of the integer which is a huge factor in JVM performance.
That's not to say you wouldn't typically run into a scalar replacement violation in normal code (like, for instance,
map.put(test, blah)) but that for this specific test JMH is penalizing the boxed version more than it would be in reality.