The Chonkerton

Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

dev_tools

Project Valhalla, Java's decade-long effort to improve performance, is finally integrating into JDK 28, according to JVM Weekly. The feature introduces "value classes"—a new way to write memory-efficient code that looks like a normal class but works as efficiently as primitive integers. Oracle engineer Lois Foltan announced the integration, which requires a staggering 197 thousand lines of code across nearly two thousand files. However, there's a catch: it ships as a preview, disabled by default, because—as Java legend Brian Goetz noted—this is only the first phase. Full support for generics and non-nullable types comes later. Valhalla aims to solve a problem nearly as old as Java itself: objects in memory are scattered, wasteful, and slow to access. Value classes fix this by packing data densely, which matters hugely for data-heavy workloads in finance, machine learning, and graphics. For most Java developers, the real payoff comes in future releases. For now, it's the beginning of a transformation that took twelve years and multiple false starts to get right.

Source: https://www.jvm-weekly.com/p/project-valhalla-explained-how-a

Listen to this story

Hear this and more stories in a personalized audio briefing.

Open The Chonkerton