Project Valhalla

Project Valhalla is augmenting the Java object model with value objects, combining the abstractions of object-oriented programming with the performance characteristics of simple primitives. Supplementary changes to Java’s generics will carry these performance gains into generic APIs.

This Project is sponsored by the HotSpot Group.

JEPs

Valhalla project features will be added to Java over multiple releases. This process is managed with JEPs, each of which facilitates the development and integration into the JDK of a cohesive set of changes.

There are five distinct feature sets under development:

  1. Value Classes and Objects, introducing objects that lack identity and thus can have optimized encodings

  2. Null-Restricted and Nullable Types, providing language support for null-aware types and runtime enforcement of null restrictions

  3. Null-Restricted Value Class Types, improving the performance of fields and arrays with null-restricted value class types

  4. Enhanced Primitive Boxing, allowing primitives to be treated more like objects

  5. Parametric JVM, preserving and optimizing generic class and method parameterizations at runtime

We’ve also worked on some supplementary tasks and features, including:

Background Documents & Presentations

These documents and presentations present a more holistic view of the Valhalla project’s goals and design considerations.

Implementation

Development takes place in a public OpenJDK repository, with occasional early-access builds being published.

Interested developers are encouraged to experiment with these early releases.

Branches in the repository include lworld (the main line of Valhalla development), master (tracking mainline OpenJDK), and various others prototyping proposed features.

Community

We welcome input from interested Java developers. Keep in mind that most theoretical ideas have been well explored over the last few years! The greatest help can be provided by those who try out concrete prototypes and can share their experiences with real-world code bases.