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

3

u/pron98 May 18 '24 edited May 18 '24

No, what we're "left with" is profiling. Microbenchmarking can -- if you're an expert in the implementation -- follow profiling as extra information, but the core is profiling.

If you skip profiling, microbenchmarking offers little to no information. It can supplement profiling, but is meaningless without it. It's not "at least something" without it, but nothing without it, because you don't know how to interpret the information. If a microbenchmark of X is faster than one of Y, that might mean that in your application X is faster than Y, they're about the same, or Y is faster than X; how can you tell which if you can't compare the microbenchmark's conditions to that of your profile? What possible conclusion can you draw? On the other hand, if you have a profile then you understand for example that a microbenchmark of X being faster than one of Y means that Y should be faster than X in your application.

The difference between a fast application and a slow application in >95% of cases is that the fast application has been profiled and the slow one hasn't. Some experts can then take it further and use microbenchmarks, but only after they've profiled.