Skip to content
Tech News
← Back to articles

JEP 401 value classes land as preview in JDK 28, with performance caveats

read original get Java Performance: The Definitive Guide by Scott Oaks → more articles
GoKawiil Brief

JDK 28 has integrated JEP 401, a Project Valhalla milestone, as a preview feature that introduces value classes to the JVM. The author explains that these classes drop object identity, letting the JVM flatten and scalarize data in memory rather than always using pointer-based references, which can boost performance in many cases.

Why It Matters

GoKawiil's interpretation of the reporting above, not reported fact.

Developers may assume value classes are a guaranteed performance upgrade over regular classes, but the piece warns that mixing methods optimized for flattened versus reference representations can force costly conversions, sometimes making code slower than before. Understanding these tradeoffs matters as more codebases, and increasingly AI coding assistants, begin adopting value classes without grasping the JVM's actual constraints.

Key Takeaways
Worth a Look

Java Performance: The Definitive Guide by Scott Oaks — If this deep dive into value classes and JVM flattening has you curious about what the runtime is really doing, this O'Reilly book is a great companion. It walks through JIT compilation, garbage collection and benchmarking so you can reason about performance instead of guessing.

See Java Performance: The Definitive Guide by Scott Oaks on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.

Source: johan-sjolen.github.io, 2026-08-26

Published there as: “Value Classes Still Need Compiler Sympathy”

Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.