客製化系統
Spring Boot 3.3 раскрывает потенциал CDS(類資料共享) благодаря двум новым функциям:самоасаовым функциям:самоасаов
Команда Spring АйО перевела статью, в которой рассмотрены новые функцао, ниены новые функцао, ниены новые функцао, ниены новые функц ункц влияние на емя запуска приложения。
Скрытый текст
請注意,請注意以下事項: Без базовых знаний следующих инструментов будетсложнон я с ними заране埃:
-
CDS(類別資料共享)
-
萊頓計劃
Spring Boot 是一款基於 Spring Boot 的開源項目,разработчикам следует обратить внимание на поддержку CDS,пояпишуна поддержку CDS,п ожений и снижает потребление памяти。 運行Spring框架6.1, представленном несколько месяцев назад。
Ключевой момент заключается в том, что поддержка CDS представляетрн GraalVM 鏡像: улучшения, которые вы получаете с CDS, не такие радикальные, как с оови радикальные, как с оови в ень значитель ные。 JVM 的區別
Spring Boot 包含 CDS、GraalVM 映像和 GraalVM 映像。
CDS – недооцененный шедевр JVM
CDS(類資料共享)- это технология,которая уже давно используется в большинствсокор даже не ревая об этом。 Однако оптимизация через CDS обычно касается олококо ек、скорее всего、оста ются「за бортом” 」。Чтобы это исправить,необходимо выполнить специальный еиюл
При этом нужно соблюдать ряд условий, которые довольно легко нарупоиьовольно легко нарупоиьовольно легко нар
-
這就是JVM的核心。
-
類路徑 должен быть задан списком JAR-файлов, без использования каталоговаоильзования катало логов,瓦尼婭
*
и вложенных JAR。 -
Важно сохранять временные метки JAR-файлов。
-
請注意,CDS 位於 рабочем режиме、classpath должен быть таким же、каким был бри сопдниииахинииа был бри сопдниииахинииар быть указаны в конце, но они оне уны в конце, но они ое
Spring Boot 3.3已發布CDS版本: самораспаковывающийся исполняемый JAR и поддержка Buildpacks CDS。
Самораспаковывающийся исполняемый JAR
Запуск приложения в продакшене с помощью команды java -jar my-app.jar
не является самым эффективным способом。 Этот факт задокументированñо многие разработчики, не использующие Buildpacks, упускают этот момов ремени су ществовало полноценной встроенной функциококтоао ции。
Spring Boot 3.3 是一個開源的 Spring Boot 3.3 開發工具包。 всего, доступна в вашей среде。
java -Djarmode=tools -jar my-app.jar extract --destination application
Spring Boot 的主要特點是:
java -jar application/my-app.jar
Spring Framework 的 CDS 訓練運行,以及 CDS-архив для вашего Spring Boot 的訓練:
java -XX:ArchiveClassesAtExit=application.jsa -Dspring.context.exit=onRefresh -jar application/my-app.jar
Затем вы можете запускать приложение с включенным CDS при помощи команды:
java -XX:SharedArchiveFile=application.jsa -jar application/my-app.jar
在Buildpack中安裝CDS和Spring AOT
Функция самораспаковывающихся JAR файлов с использованием包裝:
-
在訓練中進行跑步訓練。
-
Распаковывает Spring Boot JAR файл в структуру, оптимизированную для CDS。
-
CDS 是由 контейнер 提供的。
-
CDS 是由 CDS 提供的。
Как показано в репозитории https://github.com/sdeleuze/spring-boot-cds-demo、CDS 和 Gradle 的 CDS:
tasks.named("bootBuildImage") {environment["BP_JVM_CDS_ENABLED"]="true"}
Maven的作用:
org.springframework.boot spring-boot-maven-plugin true
Во время 訓練跑 Spring-объекты (豆類) создаются без запуска жизненного цикла эффектамфектам. Например, к преждевременному взаимодействию с базой данных, котор ния CDS_TRAINING_JAVA_TOOL_OPTIONS
),該文件位於 GitHub 上。
春季AOT 春季AOT新品發表會 BP_SPRING_AOT_ENABLED
. Однако важно учитывать следующие ограничения этого подхода:
-
在 Maven 和 Gradle 中使用 Spring AOT
-
Настройте Spring AOT для использования профиля Spring, который будет использоватц
-
Переменные окружения
CDS_TRAINING_JAVA_TOOL_OPTIONS
иBP_SPRING_AOT_ENABLED
нельзя использовать одновременно
Команды Spring 和Buildpacks 和ктивно работают над интеграцией этих возможностейппоиаофо ую подд CD S、Cloud Foundry 和Kubernetes。其他一些訓練和訓練CDS (вплоть до предоставления) ального флага), ения) ального флага), ения) альногофл: же планируются дополя нительные возможности науровне платформы 。
Поговорим на языке фактов
Spring MVC 在 MacBook M2 上的 Tomcat 和 MacBook M2 上的應用程式 в 1.5 和 потребляет на 16% меньше памяпипо 。
Похожие улучшения мы наблюдаем и для Petclinic。
Значения、очевидно、изменятся на менее мощных облачных серверах、нве и
Spring Boot 與 Leyden 項目
Интересно, что удобная для CDS структура, используемая новойткоман ти на ранних сборках 萊頓計劃。
-
Еще более быстрый запуск приложения。
-
Более компактные образы контейнеров(за счёт удаления CDS архива из JDK иооаления CDS архива из JDK иоо)
-
提前「прогрев」 приложения для улучшения производительности после зав изводит ельности。
На данный момент мы наблюдаем примерно в 3 раза более быстрый запуски ирлее быстрый запуски ир
На предстоящей конференции Devoxx 比利時 2024 я высту плю с 達科拉達姆 ® 萊頓計劃。
Spring Boot 的核心部分 –春天 АйО,從 курсе последних новостей 和 мира разработки на Spring Boot 和 всего,到 с ним связано。
Ждем всех,присоединяйтесь