1

Recently, Mark Reinhold, Chief Architect of Oracle Java Platform Group, officially announced the launch of the "Leyden" project in a social media post. It is reported that the project has been approved to alleviate slow startup and performance problems by introducing "static images" on the Java platform, aiming to accelerate the creation of Java businesses.

It is understood that the "Leyden" project plan was first proposed around May 2020 and has been discussed for more than two years.

At the time, Mark Reinhold made a post on a Java mailing list about the work he proposed and led, stating that "this work is called the 'Leyden' project and will be delivered through the Java platform and the Java Development Kit ( JDK) introduced the concept of "static image" to solve these pain points.

Project Leyden introduces "static images"

The so-called "static image" introduced in the "Leyden" project is an application-independent program that is derived from an application that runs the application, not other applications.

A static image is a "closed world" relative to the classes it can load: at runtime, classes cannot be loaded from outside the image, nor can classes be dynamically created. The closed-world constraints severely limit Java's natural dynamics, especially in terms of its ability to reflect and load classes at runtime, which many existing Java frameworks and libraries rely on.

The above two constraints not only reduce the size of the image and its startup time, but they also "allow aggressive Ahead-of-time compilation, which reduces the time it takes for the image to reach peak performance, which is the A language such as C or C++ is compiled into native machine code so that the resulting binary can perform the behavior natively.

Project Leyden will accelerate optimization efforts in Java

According to reports, Leyden is a newly established project based on past projects, including the GNU compiler for Java and GraalVM's native image capabilities. GraalVM is a high-performance runtime that is performance-optimized for various languages (such as Java and JVM languages, JavaScript, Ruby, Python, etc.) and interoperable for multi-language or multi-language applications.

Since the Leyden project was inspired by GraalVM, the two projects have common components that may (or may not) make their way into the mainstream Java specification. However, in the absence of further information, some observers believe the two projects are intertwined.

As early as 2020, when the Leyden project was first proposed, Longmeado Omdia analyst Bradley Shimmin commented: "It seems that the Leyden project should be part of the GraalVM project, and I believe the author wants to do so because it achieves the same goals that GraalVM supports, except Here, they propose to create an extremely stripped-down runtime environment for a single application.".

(Project Valhalla is an ongoing effort by Oracle that introduces value types, a mechanism that allows Java programs to manage data more efficiently at runtime. Oracle says that when Project Valhalla is eventually incorporated into the JDK, the overall performance The pattern will change.)

In addition, other members of the large Java community have expressed interest and anticipation for the Leyden project. Earlier, Red Hat's senior director of product management Rich Sharples mentioned that the project "aims to provide most of what we need from OpenJDK's native Graal/SubstrateVM."

Deepening the Java Platform: Officially Open First Steps

Of course, not all applications fit well with these two constraints of the "static image" of the "Leyden" project, and not all developers are willing to accept this constraint.

But all in all, Mark Reinhold didn't take closed-world constraints from the start, but proposed an incremental approach by exploring a range of constraints, the resulting optimizations may be weaker than closed-world constraints, but the optimization should work for Extensive existing code.

This time, Mark Reinhold officially announced the launch of the "Leyden" project in an OpenJDK article on May 20 - "It's time to take the first step and start the project", also intending to pass "Leyden" " project to accelerate the creation of Java businesses.

Mark Reinhold said, "Will work gradually along the above constraints, starting small and simple, so as to be able to gain insight into the required changes to the Java platform specification". "During this process, efforts will also be made to maintain Java's core values of readability, compatibility, and versatility."

Mark Reinhold also added that, in the long run, the Leyden project developers may adopt the constraints of a completely closed world to produce completely static images. At the same time, the project will largely support existing JDK components such as JVM hotspots, C2 compilers, shared classes and application data, and JLink code tools.

Reference link: https://www.computerworld.es/tecnologia/el-proyecto-leyden-destinado-a-acelerar-la-creacion-de-empresas-en-java


MissD
955 声望40 粉丝