Java introduces static images to solve problems like slow running

In a recent social media post, Mark Reinhold, Chief Architect of Oracle’s Java Platform Group, officially announced the launch of the “Leyden” project. The project is said to have been approved and will alleviate slow startup and performance issues by introducing “static images” on the Java platform, designed to accelerate the creation of Java businesses.

message

It is understood that the “Leyden” project was first proposed around May 2020 and has been discussed for more than 2 years now.

At the time, Mark Reinhold published a post on a Java mailing list about the work he was proposing and leading, stating that “this work, called the “Leyden” project, will be implemented by introducing “static images” into the Java platform and the Java Development Kit (JDK). The work, called the “Leyden” project, will address these pain points by introducing the concept of “static images” into the Java platform and the Java Development Kit (JDK).

Leyden Project Introduces “Static Images”

The so-called “static image” introduced in the “Leyden” project is an application-independent program that derives from an application running that application and not from another application.

A static image is a “closed world” with respect to the classes it can load: at runtime, classes cannot be loaded from outside the image, nor can they be created dynamically. The closed world constraint severely limits the natural dynamics of Java, especially with respect to runtime reflection and the ability to load classes, on which many existing Java frameworks and libraries rely.

Both of these constraints not only reduce the size of images and their startup time, but they also “allow aggressive Ahead-of-time compilation, which is the compilation of high-level programming languages (such as C or C++) into native machine code, to reduce the time it takes for images to reach peak performance. The act of generating a binary file that can be executed natively.

Leyden Project to Accelerate Java Optimization Efforts

Leyden is described as a new project that builds on past projects, including the GNU Compiler for Java and the native imaging capabilities of GraalVM, a high-performance runtime optimized for performance in a variety of languages (e.g., Java and JVM languages, JavaScript, Ruby, Python, etc.), and GraalVM is a high-performance runtime optimized for performance in a variety of languages (such as Java and JVM languages, JavaScript, Ruby, Python, etc.) and interoperability for multilingual or multi-language applications.

message

Since the Leyden project was inspired by GraalVM, the two projects share common components that may (or may not) make their way into the mainstream Java specification. However, due to a lack of further information at this time, some observers believe that the two projects are intertwined.

Back in 2020 when the Leyden project was first proposed, Longmeado Omdia analyst Bradley Shimmin commented, “The Leyden project seems like it should be part of the GraalVM project, and I believe the authors want it to be, because it achieves the same goals that GraalVM supports Except here, they propose to create an extremely streamlined runtime environment for a single application.”

(The Valhalla project is an ongoing effort by Oracle to introduce value types, a mechanism that allows Java programs to manage data more efficiently at runtime.) Oracle says the entire performance landscape will change when the Valhalla project is finally incorporated into the JDK.

In addition, other members of the larger Java community have expressed interest in and anticipation of the Leyden project. Earlier, Rich Sharples, Red Hat’s Senior Director of Product Management, noted that the project is “designed to provide much of what we need from the OpenJDK’s own Graal/SubstrateVM.

Deep improvements to the Java platform: Officially the first step

Of course, not all applications will fit well within these two constraints of the “static image” of the Leyden project, and not all developers will be willing to accept this constraint.

But all in all, Mark Reinhold did not start out with closed-world constraints, but rather explored a set of constraints to come up with an incremental approach that results in optimizations that may be weaker than the closed-world constraints, but that should apply to a wider range of existing code.

This time, Mark Reinhold officially announced the launch of the “Leyden” project in a May 20 OpenJDK article – “It’s time to take the first step and start the It’s time to take the first step and start the project,” and is intended to accelerate the creation of Java businesses through the “Leyden” project.

Mark Reinhold said, “Work will be done step-by-step along the scope of the above constraints, starting small and simple to enable deeper understanding of the changes needed for the Java platform specification. “In doing so, efforts will also be made to maintain Java’s core values of readability, compatibility and universality.”

Mark Reinhold also added that in the long run, the Leyden project developers will likely adopt the constraints of a completely closed world to generate completely static images. In the meantime, the project will also largely support existing JDK components such as JVM hotspots, C2 compilers, shared class and application data, and JLink code tools.