<link rel = "stylesheet" id = "gtranslate-style-css" href = "https://websetnet.b-cdn.net/wp-content/plugins/gtranslate/gtranslate-style24.css" type = "tekst / css "media =" all ">

Java 9-forslag kunne fremskynde nogle apps, men sænke andre

Java-applikationer får hurtigere opstartstider takket være et formelt forslag om at inkludere forudgående samling i platformen.

Udkastet til Java Development Kit-forslag, der er oprettet af Vladimir Kozlov, hovedansvarlig teknisk medarbejder hos Oracle, er målrettet til optagelse i Java 9, som forventes at være tilgængelig næste sommer.

“We would love to see this make it into JDK 9, but that will of course depend on the outcome of the OpenJDK process for this JEP (JDK Enhancement Proposal),” said Georges Saab, vice president of software development in the Java platform group at Oracle, on Thursday. Ahead-of-time compilation has been a angivet mål for Java 9 at løse problemet med langsom opstart.

“JIT compilers are fast, but Java programs can become so large that it takes a long time for the JIT to warm up completely,” Kozlov’s proposal states. “Infrequently used Java methods might never be compiled at all, potentially incurring a performance penalty due to repeated interpreted invocations.”

The proposal summary notes that Java classes would be compiled to native code prior to launching the virtual machine. The ultimate goal is to improve the startup time of small or large Java applications while having “at most” a limited impact on peak performance and minimizing changes to the user workflow.

Forudgående samling ville blive gennemført via et nyt værktøj, jaotc, mens Graal teknologi, som gør det muligt at skrive en dynamisk compiler og sprog runtime tolk i Java, bruges som en kodegenererende backend. Anvendelse af AOT-kompileret kode er gennemsigtig for brugerne, men JVM-muligheder for at kontrollere adgang til og lagring af koden leveres ifølge forslaget.

The plan, however, carries performance risks. “It is possible that the use of precompiled code could result in less-than-optimal code being used, resulting in a loss of performance,” the proposal states. “Performance testing shows that some applications benefit from AOT-compiled code while others clearly show regressions.” With AOT as an an opt-in feature, possible performance regressions with user applications are avoidable. “If a user finds that an application starts up more slowly, or doesn’t reach the expected peak performance, they can just rebuild a new JDK without AOT libraries.”

Projektet afhænger af Java-Level JVM Compiler Interface, som gør det muligt for en compiler skrevet i Java at blive brugt af JVM som en dynamisk Java compiler. Det afhænger også af Graal-core at være en del af JDK. Java 9 var blevet slated for at ankomme næste marts, men a Forsinkelse på fire måneder er foreslået.

Kilde

Efterlad en kommentar

Dette websted bruger Akismet til at reducere spam. Lær, hvordan dine kommentardata behandles.