| Reduce cold startup work: no zip file system scans, lazy MediaType quality, no Loom probe (#13121) * Reduce cold startup work: no zip file system scans, lazy MediaType quality, no Loom probe - MicronautMetaServiceLoaderUtils lists META-INF/micronaut entries through ZipFile instead of opening the jar as a zip FileSystem, which re-read and indexed the whole central directory (~35 ms vs ~6.5 ms for a 13 MB jar in a fresh JVM). Entries are added in reverse jar order, the order the zip file system walk produced. - DefaultClassPathResourceLoader reads plain jar:file: entries through JarURLConnection instead of a zip FileSystem per call. - MediaType no longer assigns BigDecimal.ONE to every instance, which initialized BigDecimal while the media type constants were created. - Virtual threads are always available on Java 25: LoomSupport is deprecated for removal (#13119), LoomCondition always matches, and core uses Thread.ofVirtual() directly, so startup no longer initializes LoomSupport or the virtual thread scheduler. PrivateLoomCondition checks java.lang is opened before touching VirtualThread internals. Guide app (Netty, serde, logback), JDK 25, interleaved fresh JVMs: default JVM 435 -> 401 ms median, AOT cache 155 -> 135 ms. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Declare the virtual thread helper before the inner types Checkstyle's InnerTypeLast requires methods to come before nested types, so :micronaut-http-netty:checkstyleMain failed on the helper added in the previous commit. Moving it changes nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Answer the Sonar quality gate on the startup changes - collectJarServices only reads the names of the entries and never expands one, so the archive expansion hotspot (java:S5042) does not apply. - addJarEntry keeps the get/put pair on purpose: computeIfAbsent would add a lambda to link on the startup path this method exists to shorten (java:S3824). - Cover the new jar entry fast path of DefaultClassPathResourceLoader and the LoomSupport methods that core no longer calls itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> | 1 天前 |