@cl4es

421 Followers
285 Following
36 Posts
OpenJDK dev @ Oracle, living just north of Stockholm, Sweden. He/him. ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ง
Bloghttps://cl4es.github.io
GitHubhttps://github.com/cl4es
@mbien yes, this was actually fixed in JDK 21, with good improvements in microbenchmarks: https://github.com/openjdk/jdk/pull/13491#issuecomment-1511630835
8306075: Micro-optimize Enum.hashCode by olivergillespie ยท Pull Request #13491 ยท openjdk/jdk

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...

GitHub
@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.
@stuartmarks I post so seldom I forgot about hashtags!
Wrote about performance improvments in the OpenJDK again: https://inside.java/2025/10/20/jdk-25-performance-improvements/
Performance Improvements in JDK 25 โ€“ Inside.java

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.

@sormuras @stuartmarks I am always ready to empty a glass or two.
@bondolo Have YOU tried Java? It's FREE! Write once, run away! JVM go brrrr..
@[email protected] ... though right now I don't know what my priorities are really, so I prioritize things that look both fun and a little bit like a learning opportunity.
@[email protected] the OpenJDK build disables C2 for many short-running tasks, too. Improving performance in C1 (and interpreted modes) isn't useless - though not a priority.
@[email protected] I know some cloud providers that disable C2 on their short-running-app offerings, too. But I noticed this as I was doing some warmup analysis..

Currently reading up on C1 code to see if it'd be easy enough to optimize array.clone() to be on par with new array + System.arraycopy

https://bugs.openjdk.org/browse/JDK-8302850

Might help with warmup - but also users who disable C2 for whatever reason. Also nice to tune out, focus and maybe learn a thing or two on the way...

[JDK-8302850] Consider implementing a C1 clone intrinsic that uses ArrayCopyNode for primitive arrays - Java Bug System