Java is constantly evolving with ever increasing performance. JDK 25 comes with significant performance improvements compared to previous versions including scoped values, improved GCs, lots of compiler improvements, and much more.
@mbien sure, it can allow some pretty remarkable speed-ups to code that might be on the hot path. Constant folding unintentionally became a little bit of a theme in this article.
@cl4es is hash() of an Enum also stable for the JVM? EnumSet.conains() is still faster than Set.of(enums).contains(). Set.of() should be able to outperform EnumSet at some point if the trend continues since it has the advantage of being immutable, right?
Improve the speed of Enum.hashCode by caching the identity hashcode on first use. I've seen an application where Enum.hashCode is a hot path, and this is fairly simple speedup. The memory overh...