Java projects - Valhalla and Leyden

Java projects - Valhalla and Leyden

Project Valhalla provides a venue to explore and incubate advanced Java and language feature candidates such as - Inline Types, Generic Specialization, Enhanced volatiles, and more and Project Leyden’s major role will be to address the long-term pain points of java like slow startup time, slow time to pick performance and large footprint.

Project Valhalla by Brian Goeitz

Oracle Java Engineer Brian Goetz led project Valhalla. This project provides JVM infrastructure for working with immutable and reference-free objects, in support of efficient by-value computation with non-primitive types. 

Mainly focuses on JVM features, value types now called as inline classes.  Inline classes are codes like a class but work like an int. This means data types that are pure value-based and without an identity. In java, there are a total of eight primitive data types.  Every other type in Java is a reference type with an identity. 

Inline classes add a lot of possibilities to the languages, Valhalla has gone through several prototype implementations over the past few years. Without identity on inline classes means they can be treated just like a value, and, can be copied around, and can be flattened in an array for denser be converted into inline classes as well, and generics will be expanded to support inline classes, means finally you would finally be able to have a List.

Programmers expect an array of int to be cheaper to work with than a List of Integer objects, and they code accordingly. Now modern JVM allocation of objects is somehow easy when we compare the cost to out-of-line procedure calling.  But this operation is not easy when compared to individual operations on primitive values. So we have a binary option between existing primitive types(which avoid allocation) and other types (which allow data abstraction and other benefits of classes). This confusion often has no good solution, and the workarounds distort Java programs and APIs. Hence Valhalla projects deal with the performance by implementing the inline types, generic specialization, and enhanced volatile and other related topics.

Project Leyden By Mark Reinhold

Long-term Java disappoints for slow startup time, slow time to peak performance, and large footprint would be addressed by a proposal being floated in the OpenJDK community by Mark Reinhold, chief architect of Oracle’s Java platform group. The proposal would deal with these pain points by introducing the concept of static images to the Java platform and the JDK. A static image is a standalone program, which is derived from an application that runs that application, and no other. 

Leave a comment now