105 points · by mfiguiere · 2y ago · 32 comments
In the real world, people dont choose optimal paths in code very often. Or what was once optimal becomes suboptimal because the context changes.
Supposing that a benchmark chose to do, say, bubblesort on an insanely large list. Would that lead to more insight around how the compiler would act in the real world? Or are the pitfalls so well understood that they are universally optimized away by the compiler's earliest stages or processing?
If I were selling, say, Azul or some other alternative JDK, I might make a point of noting that it does a superior job of dealing with the code as it exists today, rather than as one might wish it to be.
GraalVM does a really impressive job with mediocre code :-)
For example, it used to be so that stuff like OpenMP was only available in professional licenses for C, C++ and Fortran compilers.
Profile guided optimisation for native executibles sounds cool. Too bad Oracle wants to keep it closed for monetisation.
ART also does PGO for free, as does OpenJ9. Both of which also handle reflection.
The thing with Java ecosystem is choice of implementations, instead of Microsoft's single implementation, specially now since most of Xamarin's work has been consumed into modern .NET.
Even really simple optimizations where the `enqueue` may just copy to its queue-owned buffers can make allocations happen exclusively from TLAB with bump allocation which are essentially no-ops for GC & the allocator. Generic benchmarking happens but is more the domain of GC developers, and not very useful for developers – because usually, your workload is different from mine.
How do I read “5x10s”? 10^5?
Makes sense.