Spring Boot — жажда скорости. CDS и разгон на старте

Данная статья посвящена практическому изучению механизмов Class Data Sharing и AppCDS. В ней рассматривается, какие именно компоненты ускоряются CDS в HotSpot JVM, почему для Spring-приложений зачастую оказывается недостаточно использования «CDS по умолчанию», а также каким образом можно собрать .jsa -архив для приложения - как в локальной среде, так и при работе с Docker. Отдельное внимание уделено теоретическим аспектам JIT-компиляции и tiered compilation , а также практической части с измерениями времени запуска. В качестве дополнения рассматривается влияние использования Spring AOT, а также переход на Java 25 и применение Spring AOT Cache.

https://habr.com/ru/companies/haulmont/articles/978528/

#spring_framework #springboot #openide #docker #dockercompose #deploy #appcds #spring_aot #intellijidea #amplicode

Spring Boot — жажда скорости. CDS и разгон на старте

Введение Доброго времени суток забредшему на заголовок читателю. Сегодня будем говорить о том, как попробовать фичу, пришедшую в мир простых смертных Java-разработчиков вместе с 10-й версией языка, и...

Хабр

So @ApacheKafka 3 in #KRaft mode combined with an auto-created #Java 19 #AppCDS archive is super dope for testing. Kafka is up and running in < 0.5 sec on my laptop.

EXTRA_ARGS="-XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=kafka.jsa" bin/kafka-server-start.sh config/kraft/server.properties

Learn about improved tools, performance, diagnostics and other hidden gems in new #Java #LTS in my new article in Java aktuell (german)
#jfr #jpackage #ZGC #Shenandoah #JNI #AppCDS #Monitoring #JNI #ForeignMemory
https://www.doag.org/fileadmin/Daten/Zeitschriften/Java_aktuell/2022/05-2022-Java_aktuell-WEB.pdf#page=10

RT @[email protected]

📢📝 Just blogged: "Building Class Data Sharing Archives with Apache Maven"

Discussing how to improve the start-up time of a #Quarkus application running on #OpenJDK by ~20%, using the @[email protected] #AppCDS feature ⚡️.

https://www.morling.dev/blog/building-class-data-sharing-archives-with-apache-maven/

🐦🔗: https://twitter.com/gunnarmorling/status/1271111915100688387

Building Class Data Sharing Archives with Apache Maven

Ahead-of-time compilation (AOT) is the big topic in the Java ecosystem lately: by compiling Java code to native binaries, developers and users benefit from vastly improved start-up times and reduced memory usage. Spearheaded by the GraalVM project, Project Leyden promises to standardize AOT in a future version of the Java platform. This makes it easy to miss out on significant performance improvements which have been made on the JVM in recent Java versions, in particular when it comes to faster start-up times. Besides a range of improvements related to class loading, linking and bytecode verification, substantial work has been done around class data sharing (CDS). Faster start-ups are beneficial in many ways: shorter turnaround times during development, quicker time-to-first-response for users in coldstart scenarios, cost savings when billed by CPU time in the cloud. With CDS, class metadata is persisted in an archive file, which during subsequent application starts is mapped into memory. This is faster than loading the actual class files, resulting in reduced start-up times. When starting multiple JVM processes on the same host, read-only archives of class metadata can also be shared between the VMs, so that less memory is consumed overall.