Oracle's Goetz Provides Update on State of Java Project Valhalla
- By John K. Waters
Brian Goetz, Oracle's Java language architect, has posted a "State of Valhalla" update to the OpenJDK mailing list on the progress to date on this now five-year-old effort to bring more flexible flattened data types to JVM-based languages and to bring the Java programming model back in line with the performance characteristics of modern hardware.
Over the past five years, Goetz and company have built five prototypes to understand different aspects of the problems Valhalla seeks to remedy.
"We believe we are now at the point where we have a clear and coherent path to enhance the Java language and virtual machine with value types," Goetz wrote in his post, "have them interoperate cleanly with existing generics, and have a compatible path for migrating our existing value-based classes to inline classes and our existing generic classes to specialized generics."
Announced in 2014, Project Valhalla is an OpenJDK project for advancing some of Goetz's (and others') ideas, including a major overhaul of Java's generics, a new approach to generic typing, and new support for value types.
The primary benefit of value types (data stored in memory) over reference types (pointers) is the removal of reference type overhead, both in memory and in computation. In the early 1990s, Goetz points out, when the JVM was being designed, the cost of a memory fetch was comparable to computational operations, such as addition. But the multi-level memory caches and instruction-level parallelism in modern CPUs has upped that cost considerably. A single cache miss might cost as much as 1,000 arithmetic issue slots, he explains. Consequently, the JVM's "pointer-rich" representations, which involves many indirections between small islands of data, "is no longer an ideal match for today's hardware."
"We aim to give developers the control to match data layouts with the performance model of today's hardware," Goetz wrote, "providing Java developers with an easier path to flat (cache-efficient) and dense (memory-efficient) data layouts without compromising abstraction or type safety."
Goetz provides a thorough update, including a host of definitions, some useful diagrams, a link to a detailed description of the language model, and even a link to the original "sketch of proposed enhancement" to the JVM and language, co-written by software architects John Rose and Guy Steele, "so you can see how far we've come."
Goetz's update defines key concepts, explains the slightly evolving need for project, and puts it all into context with a bit of history thrown in. A must-read for anyone working in the Java space.
John K. Waters is the editor in chief of a number of Converge360.com sites, with a focus on high-end development, AI and future tech. He's been writing about cutting-edge technologies and culture of Silicon Valley for more than two decades, and he's written more than a dozen books. He also co-scripted the documentary film Silicon Valley: A 100 Year Renaissance, which aired on PBS. He can be reached at email@example.com.